| | |
| | | import React from 'react' |
| | | import { useDrag, useDrop } from 'react-dnd' |
| | | import { Icon, Popover, Button } from 'antd' |
| | | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import './index.scss' |
| | | |
| | | const Card = ({ id, card, moveCard, findCard, editCard, delCard, profileCard, changeStyle, doubleClickCard }) => { |
| | |
| | | |
| | | if (card.style) { |
| | | _style = {...card.style, opacity: isDragging ? 0 : 1} |
| | | _style = resetStyle(_style) |
| | | } |
| | | |
| | | let hasProfile = false |
| | |
| | | } |
| | | |
| | | let btnElement = null |
| | | let btnstyle = resetStyle(card.btnstyle) |
| | | if (card.show === 'icon') { |
| | | btnElement = (<Button style={card.btnstyle} type="link"><Icon type={card.icon}/></Button>) |
| | | btnElement = (<Button style={btnstyle} type="link"><Icon type={card.icon}/></Button>) |
| | | } else if (card.show === 'link') { |
| | | btnElement = (<Button style={card.btnstyle} type="link">{card.label}{card.icon ? <Icon type={card.icon}/> : null}</Button>) |
| | | btnElement = (<Button style={btnstyle} type="link">{card.label}{card.icon ? <Icon type={card.icon}/> : null}</Button>) |
| | | } else { |
| | | btnElement = (<Button icon={card.icon} style={card.btnstyle}> {card.label} </Button>) |
| | | btnElement = (<Button icon={card.icon} style={btnstyle}> {card.label} </Button>) |
| | | } |
| | | |
| | | return ( |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import './index.scss' |
| | | |
| | | const BarCode = asyncComponent(() => import('@/components/barcode')) |
| | |
| | | |
| | | if (card.style) { |
| | | _style = {...card.style, opacity: isDragging ? 0 : 1} |
| | | _style = resetStyle(_style) |
| | | } |
| | | |
| | | const getContent = () => { |
| | |
| | | this.setState({ |
| | | actvisible: true, |
| | | card: card, |
| | | formlist: getActionForm(card, functip, cards.setting, usefulFields, 'card', menulist, modules) |
| | | formlist: getActionForm(card, functip, cards.setting, usefulFields, 'card', menulist, modules, cards.columns) |
| | | }) |
| | | } |
| | | |
| | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import SettingForm from './settingform' |
| | | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | |
| | | marginTop: card.style.marginTop |
| | | } |
| | | } |
| | | _style = resetStyle(_style) |
| | | |
| | | return ( |
| | | <Col span={card.setting.width || 6} offset={offset || 0}> |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | |
| | | name: card.name, |
| | | subtype: card.subtype, |
| | | setting: { interType: 'system' }, |
| | | wrap: { name: card.name, width: card.width || 24, title: '', pagestyle: 'page', switch: 'false' }, |
| | | wrap: { name: card.name, width: card.width || 24, title: '', pagestyle: 'page', switch: 'false', cardType: '' }, |
| | | style: { marginLeft: '0px', marginRight: '0px', marginTop: '8px', marginBottom: '8px' }, |
| | | headerStyle: { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: '#e8e8e8' }, |
| | | columns: [], |
| | |
| | | offset = Math.floor(offset / 2) |
| | | } |
| | | } |
| | | let _style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className="menu-data-card-edit-box" style={{...card.style}} onClick={this.clickComponent} id={card.uuid}> |
| | | <div className="menu-data-card-edit-box" style={_style} onClick={this.clickComponent} id={card.uuid}> |
| | | <NormalHeader defaultshow="hidden" config={card} updateComponent={this.updateComponent}/> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {config.subtype === 'tablecard' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="表格高度,超出时滚动,高度为空时根据内容自适应。"> |
| | | <Icon type="question-circle" /> |
| | | 高度 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('height', { |
| | | initialValue: wrap.height |
| | | })(<InputNumber min={100} max={2000} precision={0} onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {config.subtype === 'propcard' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="选择类型为《页眉/页脚》时,打印的每页里都会带有该组件。"> |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | |
| | | } |
| | | } |
| | | |
| | | let _style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className="menu-prop-card-edit-box" style={{...card.style}} onClick={this.clickComponent} id={card.uuid}> |
| | | <div className="menu-prop-card-edit-box" style={_style} onClick={this.clickComponent} id={card.uuid}> |
| | | <NormalHeader defaultshow="hidden" config={card} updateComponent={this.updateComponent}/> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import SettingForm from './settingform' |
| | | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | |
| | | render() { |
| | | const { cards } = this.props |
| | | const { card, elements, settingVisible, dict } = this.state |
| | | let _style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className="ant-col ant-col-24"> |
| | | <div className="card-item" style={card.style}> |
| | | <div className="card-item" style={_style}> |
| | | <CardCellComponent cards={cards} cardCell={card} elements={elements} updateElement={this.updateCard}/> |
| | | <div className="card-control"> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | |
| | | changeStyle = () => { |
| | | const { card } = this.state |
| | | |
| | | MKEmitter.emit('changeStyle', [card.uuid], ['background', 'border', 'padding', 'margin'], card.style) |
| | | MKEmitter.emit('changeStyle', [card.uuid], ['height', 'background', 'border', 'padding', 'margin'], card.style) |
| | | } |
| | | |
| | | getStyle = (comIds, style) => { |
| | |
| | | |
| | | render() { |
| | | const { card } = this.state |
| | | let _style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className="menu-table-card-edit-box" style={{...card.style, height: card.wrap.height}} onClick={this.clickComponent} id={card.uuid}> |
| | | <div className="menu-table-card-edit-box" style={_style} onClick={this.clickComponent} id={card.uuid}> |
| | | <NormalHeader config={card} updateComponent={this.updateComponent}/> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | |
| | | } trigger="hover"> |
| | | <Icon type="tool" /> |
| | | </Popover> |
| | | <div style={{minHeight: card.wrap.height - 90}}> |
| | | <div style={{minHeight: 'calc(100% - 90px)'}}> |
| | | {card.subcards.map(subcard => (<CardComponent key={subcard.uuid} cards={card} card={subcard} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))} |
| | | </div> |
| | | {card.setting.laypage === 'true' ? <Pagination size="small" total={50} /> : null} |
| | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import SettingForm from './settingform' |
| | | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | |
| | | _style.boxShadow = '0 0 4px ' + _style.shadow |
| | | } |
| | | _style.height = cards.style.height |
| | | _style = resetStyle(_style) |
| | | |
| | | return ( |
| | | <div className="card-item" style={_style} onClick={this.clickComponent} id={card.uuid}> |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | |
| | | |
| | | render() { |
| | | const { card } = this.state |
| | | let _style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className="menu-data-carousel-edit-box" style={{...card.style}} onClick={this.clickComponent} id={card.uuid}> |
| | | <div className="menu-data-carousel-edit-box" style={_style} onClick={this.clickComponent} id={card.uuid}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <WrapComponent config={card} updateConfig={this.updateComponent}/> |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | |
| | | |
| | | render() { |
| | | const { card } = this.state |
| | | let _style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className="menu-prop-carousel-edit-box" style={{...card.style}} onClick={this.clickComponent} id={card.uuid}> |
| | | <div className="menu-prop-carousel-edit-box" style={_style} onClick={this.clickComponent} id={card.uuid}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="plus" title="添加卡片" onClick={this.addCard} type="plus" /> |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import { chartColors } from '@/utils/option.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | |
| | | |
| | | render() { |
| | | const { card } = this.state |
| | | let _style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className="menu-line-chart-edit-box" style={{...card.style, height: card.plot.height || 400}} onClick={this.clickComponent} id={card.uuid}> |
| | | <div className="menu-line-chart-edit-box" style={{..._style, height: card.plot.height || 400}} onClick={this.clickComponent} id={card.uuid}> |
| | | <NormalHeader config={card} updateComponent={this.updateComponent}/> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | |
| | | |
| | | render() { |
| | | const { card } = this.state |
| | | let _style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className="menu-pie-chart-edit-box" style={{...card.style, height: card.plot.height || 400}} onClick={this.clickComponent} id={card.uuid}> |
| | | <div className="menu-pie-chart-edit-box" style={{..._style, height: card.plot.height || 400}} onClick={this.clickComponent} id={card.uuid}> |
| | | <NormalHeader config={card} updateComponent={this.updateComponent}/> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | |
| | | |
| | | render() { |
| | | const { card } = this.state |
| | | let _style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className="menu-editor-sand-box" style={{...card.style}} onClick={this.clickComponent} id={card.uuid}> |
| | | <div className="menu-editor-sand-box" style={_style} onClick={this.clickComponent} id={card.uuid}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <WrapComponent config={card} updateConfig={this.updateComponent} /> |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import './index.scss' |
| | |
| | | |
| | | render() { |
| | | const { group } = this.state |
| | | let _style = resetStyle(group.style) |
| | | |
| | | return ( |
| | | <div className="menu-group-edit-box" style={group.style} onClick={this.clickComponent} id={group.uuid}> |
| | | <div className="menu-group-edit-box" style={_style} onClick={this.clickComponent} id={group.uuid}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <SettingComponent config={group} updateConfig={this.updateComponent} /> |
| | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import { getSearchForm } from '@/templates/zshare/formconfig' |
| | | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import SearchForm from '@/templates/sharecomponent/searchcomponent/searchform' |
| | | import DragElement from './dragsearch' |
| | |
| | | |
| | | render() { |
| | | const { dict, card, visible, sqlVerifing } = this.state |
| | | let _style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className={`main-search-edit-list ${card.wrap.float} ${card.wrap.show || ''}`} onClick={this.clickComponent} id={card.uuid} style={card.style}> |
| | | <div className={`main-search-edit-list ${card.wrap.float} ${card.wrap.show || ''}`} onClick={this.clickComponent} id={card.uuid} style={_style}> |
| | | <DragElement |
| | | list={card.search} |
| | | handleList={this.handleList} |
| | |
| | | |
| | | const { TextArea } = Input |
| | | const actionTypeOptions = { |
| | | pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width'], |
| | | prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width'], |
| | | exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width'], |
| | | excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width'], |
| | | excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'execSuccess', 'execError', 'syncComponent', 'resetPageIndex', 'pagination', 'search', 'width'], |
| | | popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'resetPageIndex', 'width'], |
| | | tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'linkmenu', 'width'], |
| | | innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'icon', 'class', 'width', 'open'], |
| | | funcbutton: ['label', 'OpenType', 'funcType', 'show', 'icon', 'class', 'width'] |
| | | pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'controlField', 'controlVal'], |
| | | prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'controlField', 'controlVal'], |
| | | exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'controlField', 'controlVal'], |
| | | excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'controlField', 'controlVal'], |
| | | excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'execSuccess', 'execError', 'syncComponent', 'resetPageIndex', 'pagination', 'search', 'width', 'controlField', 'controlVal'], |
| | | popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'resetPageIndex', 'width', 'controlField', 'controlVal'], |
| | | tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'linkmenu', 'width', 'controlField', 'controlVal'], |
| | | innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'icon', 'class', 'width', 'open', 'controlField', 'controlVal'], |
| | | funcbutton: ['label', 'OpenType', 'funcType', 'show', 'icon', 'class', 'width', 'controlField', 'controlVal'] |
| | | } |
| | | |
| | | class ActionForm extends Component { |
| | |
| | | getPopupContainer={() => document.getElementById('winter')} |
| | | > |
| | | {item.options.map((option, index) => |
| | | <Select.Option id={`${index}`} title={option.text} key={`${index}`} value={option.value}> |
| | | {item.key === 'icon' && option.value && <Icon type={option.value} />} {option.text} |
| | | <Select.Option id={index} key={index} value={option.value || option.field}> |
| | | {item.key === 'icon' && option.value ? <Icon type={option.value} /> : ''} {option.text || option.label} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | |
| | | import React from 'react' |
| | | import { useDrag, useDrop } from 'react-dnd' |
| | | import { Icon, Button, Popover } from 'antd' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import './index.scss' |
| | | |
| | | const Card = ({ id, card, moveCard, findCard, editCard, delCard, copyCard, changeStyle, profileCard, doubleClickCard }) => { |
| | |
| | | } |
| | | |
| | | let btnElement = null |
| | | let _style = resetStyle(card.btnstyle) |
| | | if (card.show === 'icon') { |
| | | btnElement = ( |
| | | <Button |
| | | type="link" |
| | | icon={card.icon} |
| | | style={card.btnstyle} |
| | | style={_style} |
| | | onDoubleClick={() => doubleClickCard(id)} |
| | | >{card.icon ? '' : card.label}</Button> |
| | | ) |
| | |
| | | btnElement = ( |
| | | <Button |
| | | type="link" |
| | | style={card.btnstyle} |
| | | style={_style} |
| | | onDoubleClick={() => doubleClickCard(id)} |
| | | >{card.label}{card.icon ? <Icon type={card.icon}/> : null}</Button> |
| | | ) |
| | |
| | | btnElement = ( |
| | | <Button |
| | | icon={card.icon} |
| | | style={card.btnstyle} |
| | | style={_style} |
| | | onDoubleClick={() => doubleClickCard(id)} |
| | | > |
| | | {card.label} |
| | |
| | | * @param {*} usefulFields 存储过程可用的开始字段 |
| | | * @param {*} type 按钮类型,用于区分可选的打开方式 |
| | | */ |
| | | export function getActionForm (card, functip, setting, usefulFields, type, menulist = [], modules = []) { |
| | | export function getActionForm (card, functip, setting, usefulFields, type, menulist = [], modules = [], columns = []) { |
| | | let appMenus = [] |
| | | let opentypes = [ |
| | | { |
| | |
| | | type: 'radio', |
| | | key: 'show', |
| | | label: "显示为", |
| | | initVal: card.show || 'icon', |
| | | initVal: card.show || 'button', |
| | | required: true, |
| | | options: [{ |
| | | value: 'icon', |
| | |
| | | initVal: card.syncComponent || [], |
| | | required: false, |
| | | options: modules |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'controlField', |
| | | label: '控制字段', |
| | | tooltip: '显示控制字段,可根据行数据控制按钮是否显示。', |
| | | initVal: card.controlField || '', |
| | | required: false, |
| | | forbid: card.$type !== 'tableButton', |
| | | options: [{label: '无', field: ''}, ...columns] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'controlVal', |
| | | label: '控制值', |
| | | tooltip: '当选择控制字段,且字段值与控制值相等时,按钮会隐藏,多个值用逗号分隔。', |
| | | initVal: card.controlVal || '', |
| | | forbid: card.$type !== 'tableButton', |
| | | required: false |
| | | } |
| | | ] |
| | | |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import './index.scss' |
| | | |
| | | const SearchComponent = asyncComponent(() => import('@/menu/components/share/searchcomponent')) |
| | |
| | | show = false |
| | | } |
| | | } |
| | | let _style = resetStyle(config.headerStyle) |
| | | |
| | | return ( |
| | | <div className={'normal-header' + (!show ? ' hidden' : '')} style={config.headerStyle}> |
| | | <div className={'normal-header' + (!show ? ' hidden' : '')} style={_style}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | |
| | | if (this.props.rowSpan !== nextProps.rowSpan || this.props.colSpan !== nextProps.colSpan) { |
| | | return true |
| | | } |
| | | |
| | | if (!nextProps.column) return false |
| | | |
| | | return !is(fromJS(this.props.column), fromJS(nextProps.column)) || |
| | | !is(fromJS(this.props.fields), fromJS(nextProps.fields)) || |
| | | this.props.index !== nextProps.index || |
| | | this.props.rowSpan !== nextProps.rowSpan || |
| | | this.props.colSpan !== nextProps.colSpan |
| | | this.props.index !== nextProps.index |
| | | } |
| | | |
| | | render() { |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | |
| | | |
| | | render() { |
| | | const { card } = this.state |
| | | let _style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className="menu-normal-table-edit-box" style={{...card.style, height: card.wrap.height}} onClick={this.clickComponent} id={card.uuid}> |
| | | <div className="menu-normal-table-edit-box" style={_style} onClick={this.clickComponent} id={card.uuid}> |
| | | <NormalHeader defaultshow="hidden" hideSearch="true" config={card} updateComponent={this.updateComponent}/> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import DraggableTabs from './dragabletabs' |
| | | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | |
| | | |
| | | render() { |
| | | const { tabs, dict, labelvisible, editab } = this.state |
| | | let _style = resetStyle(tabs.style) |
| | | |
| | | return ( |
| | | <div className="menu-tabs-edit-box" style={tabs.style} onClick={this.clickComponent} id={tabs.uuid}> |
| | | <div className="menu-tabs-edit-box" style={_style} onClick={this.clickComponent} id={tabs.uuid}> |
| | | <DraggableTabs tabPosition={tabs.setting.position} type={tabs.setting.tabStyle} tabsMove={this.moveSwitch}> |
| | | {tabs.subtabs.map(tab => ( |
| | | <TabPane tab={ |
| | |
| | | const NormalForm = asyncComponent(() => import('@/menu/components/form/normal-form')) |
| | | const NormalGroup = asyncComponent(() => import('@/menu/components/group/normal-group')) |
| | | const CodeSandbox = asyncComponent(() => import('@/menu/components/code/sandbox')) |
| | | const NormalLogin = asyncComponent(() => import('@/pc/components/login/normal-login')) |
| | | |
| | | const Card = ({ id, card, moveCard, findCard, delCard, updateConfig }) => { |
| | | const originalIndex = findCard(id).index |
| | |
| | | return (<NormalGroup group={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } else if (card.type === 'code') { |
| | | return (<CodeSandbox card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } else if (card.type === 'login') { |
| | | let height = '' |
| | | if (card.wrap && card.wrap.height) { |
| | | height = card.wrap.height.replace(/\d+vw/ig, (word) => { |
| | | return parseFloat(word) * 350 / 100 + 'px' |
| | | }).replace(/\d+vh/ig, (word) => { |
| | | return parseFloat(word) * 615 / 100 + 'px' |
| | | }) |
| | | } |
| | | |
| | | return (<> |
| | | <NormalLogin card={card} updateConfig={updateConfig} deletecomponent={delCard}/> |
| | | <div style={{float: 'right', height}}></div> |
| | | </>) |
| | | } |
| | | } |
| | | return ( |
| | |
| | | code: '自定义', |
| | | carousel: '轮播', |
| | | form: '表单', |
| | | card: '卡片' |
| | | card: '卡片', |
| | | login: '登录' |
| | | } |
| | | let i = 1 |
| | | |
| | |
| | | import Carousel from '@/assets/mobimg/carousel.png' |
| | | import Carousel1 from '@/assets/mobimg/carousel1.png' |
| | | import form from '@/assets/mobimg/form.png' |
| | | import Login from '@/assets/mobimg/login.png' |
| | | |
| | | // 组件配置信息 |
| | | export const menuOptions = [ |
| | |
| | | { type: 'menu', url: SandBox, component: 'code', subtype: 'sandbox', title: '自定义', width: 24 }, |
| | | { type: 'menu', url: Pie2, component: 'pie', subtype: 'nightingale', title: '南丁格尔图', width: 24 }, |
| | | { type: 'menu', url: group, component: 'group', subtype: 'normalgroup', title: '分组', width: 24 }, |
| | | { type: 'menu', url: Login, component: 'login', subtype: 'normallogin', title: '登录', width: 24 }, |
| | | ] |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import './index.scss' |
| | | |
| | | const LoginForm = asyncComponent(() => import('./loginform')) |
| | |
| | | const { card } = this.props |
| | | |
| | | if (card.isNew) { |
| | | let ismob = sessionStorage.getItem('appType') === 'mob' |
| | | let _card = { |
| | | uuid: card.uuid, |
| | | type: card.type, |
| | |
| | | width: card.width || 24, |
| | | name: card.name, |
| | | subtype: card.subtype, |
| | | wrap: { name: card.name, width: card.width || 24, loginWays: ['uname_pwd', 'sms_vcode'] }, |
| | | wrap: { name: card.name, width: card.width || 24, loginWays: ['uname_pwd'] }, |
| | | style: { background: '#ffffff', width: '330px', borderRadius: '4px', marginLeft: '55vw' }, |
| | | loginWays: [ |
| | | {type: 'uname_pwd', label: '账号密码', remember: 'true', labelStyle: {}, submitStyle: {}, submitLabel: '登录'}, |
| | | {type: 'sms_vcode', label: '短信验证码', labelStyle: {}, submitStyle: {}, submitLabel: '登录'} |
| | | ] |
| | | } |
| | | |
| | | if (ismob) { |
| | | delete _card.style.width |
| | | delete _card.style.borderRadius |
| | | delete _card.style.marginLeft |
| | | |
| | | _card.style.paddingTop = '20px' |
| | | } |
| | | |
| | | if (card.config) { |
| | |
| | | |
| | | render() { |
| | | const { card, dict } = this.state |
| | | let style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className="login-edit-box" style={{...card.style}} onClick={this.clickComponent} id={card.uuid}> |
| | | <div className="login-edit-box" style={style} onClick={this.clickComponent} id={card.uuid}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <WrapComponent config={card} updateConfig={this.updateComponent} /> |
| | |
| | | } trigger="hover"> |
| | | <Icon type="tool" /> |
| | | </Popover> |
| | | <LoginForm loginWays={card.loginWays} wrap={card.wrap} dict={dict} /> |
| | | <LoginForm loginWays={card.loginWays} wrap={card.wrap} menuId={card.uuid} dict={dict} /> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | z-index: 1; |
| | | box-shadow: 0px 0px 4px #1890ff; |
| | | } |
| | | |
| | | .mk-mob-view .login-edit-box { |
| | | display: block; |
| | | .login-way-wrap.simple { |
| | | display: none; |
| | | } |
| | | .ant-input { |
| | | border: 0; |
| | | border-radius: 0; |
| | | border-bottom: 1px solid #d9d9d9; |
| | | box-shadow: none!important; |
| | | } |
| | | } |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Icon, Input, Button, Checkbox } from 'antd' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | class LoginTabForm extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, |
| | | menuId: PropTypes.string, |
| | | loginWays: PropTypes.array, |
| | | wrap: PropTypes.array, |
| | | } |
| | |
| | | this.setState({activeWay}) |
| | | } |
| | | |
| | | changeMenu = () => { |
| | | const { wrap, menuId } = this.props |
| | | |
| | | MKEmitter.emit('changeEditMenu', { |
| | | fixed: false, |
| | | MenuID: wrap.link === 'linkmenu' ? wrap.linkmenu : menuId, |
| | | copyMenuId: '', |
| | | MenuNo: '', |
| | | MenuName: '' |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | |
| | | <Checkbox>记住密码</Checkbox> |
| | | </Form.Item> |
| | | <Form.Item className="btn-login"> |
| | | <Button type="primary" htmlType="submit" className="login-form-button"> |
| | | <Button type="primary" onDoubleClick={() => this.changeMenu()} className="login-form-button"> |
| | | 登录 |
| | | </Button> |
| | | </Form.Item> |
| | |
| | | /> |
| | | </Form.Item> |
| | | <Form.Item className="btn-login"> |
| | | <Button type="primary" htmlType="submit" className="login-form-button"> |
| | | <Button type="primary" onDoubleClick={() => this.changeMenu()} className="login-form-button"> |
| | | 登录 |
| | | </Button> |
| | | </Form.Item> |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Tooltip, Icon, InputNumber, Select, Checkbox, notification } from 'antd' |
| | | import { Form, Row, Col, Input, Tooltip, Icon, InputNumber, Select, Checkbox, notification, Radio } from 'antd' |
| | | |
| | | import StyleInput from '@/menu/stylecontroller/styleInput' |
| | | import './index.scss' |
| | |
| | | |
| | | state = { |
| | | roleList: [], |
| | | msgTemps: [] |
| | | msgTemps: [], |
| | | appMenus: [], |
| | | link: this.props.wrap.link || 'menu' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | msgTemps = [] |
| | | } |
| | | |
| | | this.setState({roleList, msgTemps}) |
| | | let appMenus = sessionStorage.getItem('appMenus') |
| | | if (appMenus) { |
| | | try { |
| | | appMenus = JSON.parse(appMenus) |
| | | } catch { |
| | | appMenus = [] |
| | | } |
| | | } else { |
| | | appMenus = [] |
| | | } |
| | | |
| | | this.setState({roleList, msgTemps, appMenus}) |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | |
| | | render() { |
| | | const { wrap } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { roleList, msgTemps } = this.state |
| | | const { roleList, msgTemps, appMenus, link } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | })(<StyleInput options={['px', 'vh', 'vw', '%']}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label="链接"> |
| | | {getFieldDecorator('link', { |
| | | initialValue: wrap.link || 'menu' |
| | | })( |
| | | <Radio.Group onChange={(e) => this.setState({link: e.target.value})}> |
| | | <Radio key="menu" value="menu"> 菜单 </Radio> |
| | | <Radio key="linkmenu" value="linkmenu"> 关联菜单 </Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {link === 'linkmenu' ? <Col span={12}> |
| | | <Form.Item label="关联菜单"> |
| | | {getFieldDecorator('linkmenu', { |
| | | initialValue: wrap.linkmenu || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.select'] + '菜单!' |
| | | } |
| | | ] |
| | | })( |
| | | <Select |
| | | showSearch |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | > |
| | | {appMenus.map(option => |
| | | <Select.Option key={option.MenuID} value={option.MenuID}>{option.MenuName}</Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {/* $验证码$ $mob$ $send_type$ */} |
| | | <Col span={12}> |
| | | <Form.Item label={ |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="默认隐藏菜单栏,鼠标在靠近顶部时显示。"> |
| | | <Icon type="question-circle" /> |
| | | 悬浮显示 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('hover', { |
| | | initialValue: wrap.hover || 'false' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="true">启用</Radio> |
| | | <Radio value="false">不启用</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | </div> |
| | |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'button') { |
| | | if (card.$type === 'tableButton' && card.controlField) { // 表格中按钮隐藏控制 |
| | | if (data[card.controlField] === card.controlVal) { |
| | | return null |
| | | } else if (card.controlVal && card.controlVal.split(',').includes(data[card.controlField])) { |
| | | return null |
| | | } |
| | | } |
| | | if (['exec', 'prompt', 'pop'].includes(card.OpenType)) { |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | return null |
| | | } |
| | | |
| | | render() { |
| | |
| | | } |
| | | |
| | | if (_config.setting.laypage) { |
| | | _config.wrap.contentHeight = _config.wrap.height - (showHeader ? 85 : 40) |
| | | _config.wrap.contentHeight = showHeader ? 'calc(100% - 85px)' : 'calc(100% - 40px)' |
| | | } else { |
| | | _config.wrap.contentHeight = _config.wrap.height - (showHeader ? 45 : 0) |
| | | _config.wrap.contentHeight = showHeader ? 'calc(100% - 45px)' : '100%' |
| | | } |
| | | |
| | | _config.columns.forEach(item => { |
| | |
| | | const { config, loading, data, BID, pageIndex, preIndex, total } = this.state |
| | | |
| | | return ( |
| | | <div className="custom-table-card-box" style={{...config.style, height: config.wrap.height}}> |
| | | <div className="custom-table-card-box" style={{...config.style}}> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | {data ? <div className="ant-spin-blur"></div> : null} |
| | |
| | | cell.syncComponentId = cell.syncComponent ? cell.syncComponent.pop() : '' |
| | | cell.$menuId = item.uuid |
| | | cell.$tabId = tabId |
| | | cell.$type = 'CustomPage' |
| | | cell.$view = 'CustomPage' |
| | | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | |
| | | cell.syncComponentId = cell.syncComponent ? cell.syncComponent.pop() : '' |
| | | cell.$menuId = item.uuid |
| | | cell.$tabId = tabId |
| | | cell.$type = 'CustomPage' |
| | | cell.$view = 'CustomPage' |
| | | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | |
| | | cell.syncComponentId = cell.syncComponent ? cell.syncComponent.pop() : '' |
| | | cell.$menuId = item.uuid |
| | | cell.$tabId = tabId |
| | | cell.$type = 'CustomPage' |
| | | cell.$view = 'CustomPage' |
| | | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | |
| | | cell.syncComponentId = cell.syncComponent ? cell.syncComponent.pop() : '' |
| | | cell.$menuId = item.uuid |
| | | cell.$tabId = tabId |
| | | cell.$type = 'CustomPage' |
| | | cell.$view = 'CustomPage' |
| | | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | |
| | | cell.syncComponentId = cell.syncComponent ? cell.syncComponent.pop() : '' |
| | | cell.$menuId = item.uuid |
| | | cell.$tabId = tabId |
| | | cell.$type = 'CustomPage' |
| | | cell.$view = 'CustomPage' |
| | | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | |
| | | |
| | | if (btn.uuid !== tabId) return |
| | | |
| | | if (btn.$type === 'CustomPage') { |
| | | if (btn.$view === 'CustomPage') { |
| | | if (btn.popClose !== 'never') { |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.popClose, btn) |
| | | } |
| | |
| | | onClick={() => {this.actionTrigger()}} |
| | | >{show === 'icon' && btn.icon ? '' : btn.label}</Button> : null} |
| | | <Modal |
| | | className={'popview-modal ' + (btn.$type === 'CustomPage' ? 'custom-popview' : '')} |
| | | className={'popview-modal ' + (btn.$view === 'CustomPage' ? 'custom-popview' : '')} |
| | | title={btn.label} |
| | | width={'85vw'} |
| | | maskClosable={false} |
| | |
| | | ]} |
| | | destroyOnClose |
| | | > |
| | | {btn.$type !== 'CustomPage' ? <SubTabTable |
| | | {btn.$view !== 'CustomPage' ? <SubTabTable |
| | | Tab={btn} |
| | | MenuID={btn.linkTab} |
| | | SupMenuID={this.props.MenuID} |
| | | BID={popData ? primaryId : this.props.BID} |
| | | BData={popData || this.props.BData} |
| | | /> : null} |
| | | {btn.$type === 'CustomPage' ? <CustomPage Tab={btn} MenuID={btn.uuid} param={{BID: (popData ? primaryId : this.props.BID), data: (popData || this.props.BData)}} /> : null} |
| | | {btn.$view === 'CustomPage' ? <CustomPage Tab={btn} MenuID={btn.uuid} param={{BID: (popData ? primaryId : this.props.BID), data: (popData || this.props.BData)}} /> : null} |
| | | </Modal> |
| | | </div> |
| | | ) |
| | |
| | | }) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 重置移动端style |
| | | * @return {Object} style |
| | | */ |
| | | export function resetStyle (style) { |
| | | if (sessionStorage.getItem('appType') === 'mob' && style) { |
| | | let _style = JSON.stringify(style) |
| | | |
| | | _style = _style.replace(/\d+vw/ig, (word) => { |
| | | return parseFloat(word) * 350 / 100 + 'px' |
| | | }).replace(/\d+vh/ig, (word) => { |
| | | return parseFloat(word) * 615 / 100 + 'px' |
| | | }) |
| | | |
| | | return JSON.parse(_style) |
| | | } else { |
| | | return style |
| | | } |
| | | |
| | | } |
| | |
| | | {this.props.dict['login.submit']} |
| | | </Button> |
| | | </Form.Item> : null} |
| | | {options.sysType === 'cloud' ? <Form.Item className="register-line"> |
| | | {options.sysType === 'cloud' && options.cdomain.indexOf('mk9h') > -1 ? <Form.Item className="register-line"> |
| | | <a href="http://minkesoft.com/#/signup" target="_blank" rel="noopener noreferrer" className="register">注册</a> |
| | | <a href="http://minkesoft.com/#/forgotPwd" target="_blank" rel="noopener noreferrer" className="forgot">忘记密码?</a> |
| | | </Form.Item> : null} |
| | |
| | | MenuNo={MenuNo} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {config && MenuType === 'custom' ? <UrlFieldComponent |
| | | config={config} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {config && MenuType === 'home' ? <HomeForm |
| | | dict={dict} |
| | | config={config} |
| | |
| | | config={config} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {config ? <UrlFieldComponent |
| | | config={config} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {/* 表名添加 */} |
| | | {config ? <TableComponent config={config} updatetable={this.updateConfig}/> : null} |
| | | </Panel> |
| | |
| | | } |
| | | } |
| | | .mob-shell { |
| | | width: 375px; |
| | | width: 376px; |
| | | height: 680px; |
| | | margin: 0 auto; |
| | | background: #000000; |