| | |
| | | {value: 'no-border', label: '无边框'}, |
| | | {value: 'bold-border', label: '边框加粗'}, |
| | | {value: 'deep-border', label: '边框颜色加深'}, |
| | | {value: 'word-break', label: '强制换行'}, |
| | | ], |
| | | span: 24 |
| | | }, |
| | |
| | | import { SnippetsOutlined } from '@ant-design/icons' |
| | | import md5 from 'md5' |
| | | |
| | | import Utils from '@/utils/utils.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | // import './index.scss' |
| | |
| | | } |
| | | |
| | | this.pasteFormRef.handleConfirm().then(res => { |
| | | if (!res.copyType) { |
| | | if (!res.copyType || (res.copyType === 'components' && this.props.vType !== res.type)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '配置信息格式错误!', |
| | |
| | | |
| | | let menu = fromJS(window.GLOB.customMenu).toJS() |
| | | |
| | | if (res.copyType === 'components') { |
| | | let commonId = Utils.getuuid() |
| | | |
| | | res.interfaces = res.interfaces.map(inter => { |
| | | inter.uuid = md5(commonId + inter.uuid) |
| | | return inter |
| | | }) |
| | | |
| | | res.components = MenuUtils.resetConfig(res.components, commonId, true) |
| | | |
| | | if (menu.components.length) { |
| | | if ( |
| | | menu.components.findIndex(m => m.type === 'search' || (m.type === 'topbar' && m.wrap.type !== 'navbar')) > -1 && |
| | | res.components.findIndex(m => m.type === 'search' || (m.type === 'topbar' && m.wrap.type !== 'navbar')) > -1 |
| | | ) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '搜索条件不可重复添加!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | if ( |
| | | menu.components.findIndex(m => m.type === 'topbar') > -1 && |
| | | res.components.findIndex(m => m.type === 'topbar') > -1 |
| | | ) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '导航栏不可重复添加!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | |
| | | this.setState({visible: false}) |
| | | |
| | | this.props.insert(res) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '粘贴成功!', |
| | | duration: 2 |
| | | }) |
| | | |
| | | return |
| | | } |
| | | |
| | | if (!options.includes(res.copyType)) { |
| | | if (type && types[res.copyType]) { |
| | | notification.warning({ |
| | |
| | | } |
| | | } |
| | | } |
| | | .custom-braft-editor-box.word-break { |
| | | .braft-content { |
| | | table { |
| | | td, th { |
| | | word-break: break-all!important; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .custom-braft-editor-box.tb-flex { |
| | | .braft-content { |
| | | table { |
| | |
| | | 创建凭证 |
| | | {verify.voucher && verify.voucher.enabled ? <span className="count-tip">1</span> : null} |
| | | </span> |
| | | } key="voucher"> |
| | | } key="voucher" disabled={card.Ot === 'requiredOnce'}> |
| | | <VoucherForm |
| | | voucher={voucher} |
| | | columns={columns} |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Row, Col, Select, Switch, notification } from 'antd' |
| | | import { Form, Row, Col, Select, Switch, notification, Modal } from 'antd' |
| | | import { ConsoleSqlOutlined } from '@ant-design/icons' |
| | | // import './index.scss' |
| | | |
| | | class UniqueForm extends Component { |
| | |
| | | }) |
| | | } |
| | | |
| | | voucherSql = () => { |
| | | let BVoucherType = this.props.form.getFieldValue('BVoucherType') |
| | | let VoucherTypeOne = this.props.form.getFieldValue('VoucherTypeOne') |
| | | let linkField = this.props.form.getFieldValue('linkField') |
| | | |
| | | let _detail = this.state.voucherDetail.filter(item => item.ModularDetailCode === VoucherTypeOne)[0] |
| | | |
| | | if (!_detail) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '凭证类型或凭证标识不存在!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let _sql = `/* 创建凭证 */ |
| | | exec s_BVoucher_Create |
| | | @Bill = @${linkField || ''}, |
| | | @BVoucherType ='${BVoucherType}', |
| | | @VoucherTypeOne ='${VoucherTypeOne}', |
| | | @VoucherTypeTwo ='${_detail.VoucherTypeTwo}', |
| | | @Type =${_detail.IDefine1}, |
| | | @UserID=@UserID@, |
| | | @Username=@Username, |
| | | @FullName=@FullName, |
| | | @BVoucher =@BVoucher OUTPUT , |
| | | @FIBVoucherDate =@FIBVoucherDate OUTPUT , |
| | | @FiYear =@FiYear OUTPUT , |
| | | @ErrorCode =@ErrorCode OUTPUT, |
| | | @retmsg=@retmsg OUTPUT |
| | | if @ErrorCode!='' |
| | | GOTO aaa |
| | | ` |
| | | |
| | | Modal.info({ |
| | | title: '', |
| | | width: 500, |
| | | className: 'sql-example', |
| | | icon: null, |
| | | content: _sql.split(/\n\s{6}/ig).map((n, index) => <div key={index} dangerouslySetInnerHTML={{ __html: n.replace(/\s/ig, ' ') }} style={{whiteSpace: 'nowrap'}}></div>) |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const { voucherobj } = this.props |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={11}> |
| | | <Form.Item label={'是否启用'}> |
| | | <Form.Item label="是否启用"> |
| | | <Switch checkedChildren="启" unCheckedChildren="停" checked={voucherobj.enabled} onChange={this.onEnabledChange} /> |
| | | {voucherobj.enabled ? <ConsoleSqlOutlined style={{marginLeft: '20px', fontSize: '18px', color: '#1890ff', verticalAlign: 'middle'}} onClick={this.voucherSql}/> : null} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | |
| | | card.elements = card.elements.map(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { |
| | | cell.pageTemplate = '' |
| | | cell.linkmenu = '' |
| | | } |
| | | this.resetBtn(cell, commonId) |
| | | this.resetBtn(cell, commonId, clear) |
| | | } else { |
| | | cell.uuid = this.getuuid() |
| | | } |
| | |
| | | card.backElements = card.backElements.map(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { |
| | | cell.pageTemplate = '' |
| | | cell.linkmenu = '' |
| | | } |
| | | this.resetBtn(cell, commonId) |
| | | this.resetBtn(cell, commonId, clear) |
| | | } else { |
| | | cell.uuid = this.getuuid() |
| | | } |
| | |
| | | item.elements = item.elements.map(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { |
| | | cell.pageTemplate = '' |
| | | cell.linkmenu = '' |
| | | } |
| | | this.resetBtn(cell, commonId) |
| | | this.resetBtn(cell, commonId, clear) |
| | | } else { |
| | | cell.uuid = this.getuuid() |
| | | } |
| | |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | |
| | | if (cell.eleType === 'button') { |
| | | if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { |
| | | cell.pageTemplate = '' |
| | | cell.linkmenu = '' |
| | | } |
| | | |
| | | this.resetBtn(cell, commonId) |
| | | this.resetBtn(cell, commonId, clear) |
| | | } |
| | | |
| | | return cell |
| | |
| | | }) |
| | | |
| | | if (cell.subButton) { |
| | | this.resetBtn(cell.subButton, commonId) |
| | | this.resetBtn(cell.subButton, commonId, clear) |
| | | } |
| | | |
| | | return cell |
| | | }) |
| | | } else if (item.type === 'login') { |
| | | if (clear) { |
| | | item.wrap.linkmenu = '' |
| | | } |
| | | } |
| | | |
| | | if (item.btnlog) { |
| | |
| | | item.action = item.action.map(cell => { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | |
| | | if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { |
| | | cell.pageTemplate = '' |
| | | cell.linkmenu = '' |
| | | } |
| | | |
| | | this.resetBtn(cell, commonId) |
| | | this.resetBtn(cell, commonId, clear) |
| | | |
| | | return cell |
| | | }) |
| | |
| | | /** |
| | | * @description 按钮重置 |
| | | */ |
| | | static resetBtn (btn, commonId) { |
| | | static resetBtn (btn, commonId, clear = false) { |
| | | if (btn.OpenType === 'pop' || (btn.OpenType === 'funcbutton' && btn.execMode === 'pop')) { |
| | | if (btn.modal && btn.modal.fields && btn.modal.fields.length > 0) { |
| | | btn.modal.fields = btn.modal.fields.map(m => { |
| | |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (clear) { |
| | | if (btn.pageTemplate === 'linkpage') { |
| | | btn.pageTemplate = '' |
| | | } |
| | | delete btn.linkmenu |
| | | delete btn.openmenu |
| | | delete btn.refreshTab |
| | | } |
| | | |
| | | if (btn.switchTab && btn.switchTab.length > 0) { |
| | | btn.switchTab = btn.switchTab.map(m => md5(commonId + m)) |
| | | } |
| | |
| | | _sql += ` |
| | | /* 创建凭证 */ |
| | | exec s_BVoucher_Create |
| | | @Bill ='0', |
| | | @Bill = @${_voucher.linkField}, |
| | | @BVoucherType ='${_voucher.BVoucherType}', |
| | | @VoucherTypeOne ='${_voucher.VoucherTypeOne}', |
| | | @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}', |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import moment from 'moment' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { notification, Modal, Collapse, Card, Switch, Button, Typography, Spin } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons' |
| | | import { notification, Modal, Collapse, Card, Switch, Button, Typography, Spin, message } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, EyeOutlined, EyeInvisibleOutlined, CopyOutlined } from '@ant-design/icons' |
| | | import html2canvas from 'html2canvas' |
| | | import md5 from 'md5' |
| | | |
| | |
| | | insert = (item) => { |
| | | let config = fromJS(this.state.config).toJS() |
| | | |
| | | if (item.copyType === 'components') { |
| | | config.components.push(...item.components) |
| | | if (!config.interfaces) { |
| | | config.interfaces = item.interfaces |
| | | } else { |
| | | config.interfaces.push(...item.interfaces) |
| | | } |
| | | } else { |
| | | config.components.push(item) |
| | | } |
| | | |
| | | this.setState({config}) |
| | | window.GLOB.customMenu = config |
| | |
| | | const { oriConfig, config } = this.state |
| | | |
| | | return is(fromJS(oriConfig), fromJS(config)) |
| | | } |
| | | |
| | | copyMenu = () => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.enabled) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单未启用,不可复制。', |
| | | duration: 5 |
| | | }) |
| | | } else if (config.components.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未添加组件,不可复制。', |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | | let msg = { copyType: 'components', type: 'admin' } |
| | | |
| | | msg.components = config.components || [] |
| | | msg.interfaces = config.interfaces || [] |
| | | |
| | | try { |
| | | msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) |
| | | } catch (e) { |
| | | console.warn('Stringify Failure') |
| | | msg = '' |
| | | } |
| | | |
| | | let oInput = document.createElement('input') |
| | | oInput.value = msg |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | document.body.removeChild(oInput) |
| | | message.success('复制成功。') |
| | | } |
| | | } |
| | | |
| | | updateLogConfig = (config) => { |
| | |
| | | /> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '15px 0px 0px 37px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '0px 0px 0px 18px'}}>菜单组件:<CopyOutlined onClick={this.copyMenu} style={{cursor: 'pointer', color: '#1890ff'}} /></Paragraph> |
| | | <NormalCss config={config} updateConfig={this.updateConfig}/> |
| | | </> : null} |
| | | </Panel> |
| | |
| | | <SysInterface config={config} updateConfig={this.updateConfig}/> |
| | | <PictureController/> |
| | | <StyleCombControlButton menu={config} /> |
| | | <PasteController insert={this.insert} /> |
| | | <PasteController vType="admin" insert={this.insert} /> |
| | | {config ? <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} /> : null} |
| | | <Button type="primary" id="save-config" disabled={!config} className={needUpdate ? 'update-tip' : ''} onClick={this.submitConfig} loading={menuloading}>保存</Button> |
| | | <Button type="default" disabled={menuloading} onClick={this.closeView}>关闭</Button> |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { notification, Modal, Collapse, Switch, Button, message, Spin, Typography } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, ArrowLeftOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, ArrowLeftOutlined, EyeOutlined, EyeInvisibleOutlined, CopyOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | |
| | |
| | | insert = (item) => { |
| | | let config = fromJS(this.state.config).toJS() |
| | | |
| | | if (item.copyType === 'components') { |
| | | if (item.components.findIndex(m => m.type === 'topbar') > -1 && !config.style.paddingTop) { |
| | | config.style.paddingTop = '50px' |
| | | } |
| | | config.components.push(...item.components) |
| | | if (!config.interfaces) { |
| | | config.interfaces = item.interfaces |
| | | } else { |
| | | config.interfaces.push(...item.interfaces) |
| | | } |
| | | } else { |
| | | if (item.type === 'topbar' && !config.style.paddingTop) { |
| | | config.style.paddingTop = '50px' |
| | | } |
| | | |
| | | config.components.push(item) |
| | | } |
| | | |
| | | this.setState({config}) |
| | | window.GLOB.customMenu = config |
| | |
| | | return is(fromJS(oriConfig), fromJS(config)) |
| | | } |
| | | |
| | | copyMenu = () => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.enabled) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单未启用,不可复制。', |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | | let msg = { copyType: 'components', type: 'mob' } |
| | | |
| | | msg.components = [] |
| | | msg.interfaces = config.interfaces || [] |
| | | |
| | | config.components.forEach(item => { |
| | | if (item.type === 'navbar') return |
| | | |
| | | msg.components.push(item) |
| | | }) |
| | | |
| | | if (msg.components.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未添加组件,不可复制。', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | try { |
| | | msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) |
| | | } catch (e) { |
| | | console.warn('Stringify Failure') |
| | | msg = '' |
| | | } |
| | | |
| | | let oInput = document.createElement('input') |
| | | oInput.value = msg |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | document.body.removeChild(oInput) |
| | | message.success('复制成功。') |
| | | } |
| | | } |
| | | |
| | | updateLogConfig = (config) => { |
| | | config.open_edition = this.state.config.open_edition || '' |
| | | |
| | |
| | | <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '10px 0px 0px 18px'}} copyable={{ text: `${window.GLOB.baseurl}mob/index.html#/index/${sessionStorage.getItem('kei_no')}/${sessionStorage.getItem('typename')}/${sessionStorage.getItem('lang')}/${MenuId}/@BID@` }}>菜单链接</Paragraph> |
| | | <Paragraph style={{padding: '15px 0px 0px 37px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '0px 0px 0px 23px'}} copyable={{ text: `${window.GLOB.baseurl}mob/index.html#/index/${sessionStorage.getItem('kei_no')}/${sessionStorage.getItem('typename')}/${sessionStorage.getItem('lang')}/${MenuId}/@BID@` }}>菜单链接</Paragraph> |
| | | <Paragraph style={{padding: '0px 0px 0px 18px'}}>菜单组件:<CopyOutlined onClick={this.copyMenu} style={{cursor: 'pointer', color: '#1890ff'}} /></Paragraph> |
| | | <NormalCss config={config} updateConfig={this.updateConfig}/> |
| | | </> : null} |
| | | </Panel> |
| | |
| | | {config ? <Debug config={config}/> : null} |
| | | <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 组件名</Button> |
| | | <CreateView resetmenu={this.getAppMenus} /> |
| | | <PasteController insert={this.insert} /> |
| | | <PasteController vType="mob" insert={this.insert} /> |
| | | <TableNodes config={config} /> |
| | | <ViewNodes config={config} MenuId={MenuId}/> |
| | | <SysInterface config={config} updateConfig={this.updateConfig}/> |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { notification, Modal, Collapse, Switch, Button, message, Spin, Typography } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, ArrowLeftOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, ArrowLeftOutlined, EyeOutlined, EyeInvisibleOutlined, CopyOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | |
| | |
| | | insert = (item) => { |
| | | let config = fromJS(this.state.config).toJS() |
| | | |
| | | if (item.copyType === 'components') { |
| | | config.components.push(...item.components) |
| | | if (!config.interfaces) { |
| | | config.interfaces = item.interfaces |
| | | } else { |
| | | config.interfaces.push(...item.interfaces) |
| | | } |
| | | } else { |
| | | config.components.push(item) |
| | | } |
| | | |
| | | this.setState({config}) |
| | | window.GLOB.customMenu = config |
| | |
| | | return is(fromJS(oriConfig), fromJS(config)) |
| | | } |
| | | |
| | | copyMenu = () => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.enabled) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单未启用,不可复制。', |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | | let msg = { copyType: 'components', type: 'pc' } |
| | | |
| | | msg.components = [] |
| | | msg.interfaces = config.interfaces || [] |
| | | |
| | | config.components.forEach(item => { |
| | | if (item.type === 'navbar') return |
| | | |
| | | msg.components.push(item) |
| | | }) |
| | | |
| | | if (msg.components.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未添加组件,不可复制。', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | try { |
| | | msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) |
| | | } catch (e) { |
| | | console.warn('Stringify Failure') |
| | | msg = '' |
| | | } |
| | | |
| | | let oInput = document.createElement('input') |
| | | oInput.value = msg |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | document.body.removeChild(oInput) |
| | | message.success('复制成功。') |
| | | } |
| | | } |
| | | |
| | | updateLogConfig = (config) => { |
| | | config.open_edition = this.state.config.open_edition || '' |
| | | |
| | |
| | | <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '15px 0px 0px 37px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '0px 0px 0px 18px'}}>菜单组件:<CopyOutlined onClick={this.copyMenu} style={{cursor: 'pointer', color: '#1890ff'}} /></Paragraph> |
| | | <NormalCss config={config} updateConfig={this.updateConfig}/> |
| | | </> : null} |
| | | </Panel> |
| | |
| | | {config ? <Debug config={config}/> : null} |
| | | <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 组件名</Button> |
| | | <CreateView resetmenu={this.getAppMenus} /> |
| | | <PasteController insert={this.insert} /> |
| | | <PasteController vType="pc" insert={this.insert} /> |
| | | <TableNodes config={config} /> |
| | | <ViewNodes config={config} MenuId={MenuId}/> |
| | | <SysInterface config={config} updateConfig={this.updateConfig}/> |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import moment from 'moment' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { notification, Modal, Collapse, Card, Switch, Button, Typography } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons' |
| | | import { notification, Modal, Collapse, Card, Switch, Button, Typography, message } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, CopyOutlined } from '@ant-design/icons' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | |
| | | return is(fromJS(oriConfig), fromJS(config)) |
| | | } |
| | | |
| | | copyMenu = () => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.enabled) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单未启用,不可复制。', |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | | let msg = { copyType: 'components', type: 'admin', interfaces: [] } |
| | | |
| | | msg.components = fromJS(config.components).toJS() |
| | | msg.components.forEach((item, i) => { |
| | | if (item.type === 'tabs') { |
| | | item.name = '标签组' + i |
| | | item.width = 24 |
| | | item.subtype = 'tabs' |
| | | item.setting = {autoSwitch: 'false', blacklist: [], name: item.name, position: 'top', supModule: [], tabStyle: 'line', width: 24} |
| | | |
| | | item.subtabs.forEach(tab => { |
| | | tab.components[0].subtype = 'normaltable' |
| | | tab.components[0].width = 24 |
| | | tab.components[0].wrap.width = 24 |
| | | tab.components[0].wrap.name = tab.components[0].name |
| | | |
| | | tab.components[0].action.forEach(btn => { |
| | | if (btn.OpenType === 'popview' && btn.config) { |
| | | btn.config.Template = 'CustomPage' |
| | | if (btn.config.components[0]) { |
| | | btn.config.components[0].subtype = 'normaltable' |
| | | } |
| | | } |
| | | }) |
| | | tab.components[0].cols = tab.components[0].cols.filter(col => !(col.field && col.Hide === 'true')) |
| | | tab.components[0].cols.forEach(col => { |
| | | if (col.type !== 'custom') return |
| | | col.elements.forEach(btn => { |
| | | if (btn.OpenType === 'popview' && btn.config) { |
| | | btn.config.Template = 'CustomPage' |
| | | if (btn.config.components[0]) { |
| | | btn.config.components[0].subtype = 'normaltable' |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | }) |
| | | } else { |
| | | item.subtype = 'normaltable' |
| | | item.width = 24 |
| | | item.wrap.width = 24 |
| | | item.wrap.name = item.name |
| | | item.action.forEach(btn => { |
| | | if (btn.OpenType === 'popview' && btn.config) { |
| | | btn.config.Template = 'CustomPage' |
| | | if (btn.config.components[0]) { |
| | | btn.config.components[0].subtype = 'normaltable' |
| | | } |
| | | } |
| | | }) |
| | | item.cols = item.cols.filter(col => !(col.field && col.Hide === 'true')) |
| | | item.cols.forEach(col => { |
| | | if (col.type !== 'custom') return |
| | | col.elements.forEach(btn => { |
| | | if (btn.OpenType === 'popview' && btn.config) { |
| | | btn.config.Template = 'CustomPage' |
| | | if (btn.config.components[0]) { |
| | | btn.config.components[0].subtype = 'normaltable' |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | if (msg.components[0].search && msg.components[0].search.length > 0) { |
| | | let cell = { |
| | | uuid: Utils.getuuid(), |
| | | type: 'search', |
| | | width: 24, |
| | | subtype: 'mainsearch', |
| | | name: '搜索', |
| | | search: msg.components[0].search, |
| | | style: {borderBottomColor: '#f0f0f0', borderBottomWidth: '1px'}, |
| | | wrap: {float: 'left', blacklist: [], name: '搜索', width: 24} |
| | | } |
| | | |
| | | cell.wrap.advanceType = msg.components[0].wrap.advanceType || 'modal' |
| | | cell.wrap.advanceWidth = msg.components[0].wrap.advanceWidth || 1000 |
| | | cell.wrap.searchLwidth = msg.components[0].wrap.searchLwidth || 33.3 |
| | | cell.wrap.searchRatio = msg.components[0].wrap.searchRatio || 6 |
| | | cell.wrap.resetContrl = msg.components[0].wrap.resetContrl || 'init' |
| | | cell.wrap.show = msg.components[0].wrap.show || 'true' |
| | | |
| | | if (cell.wrap.advanceType === 'drawer') { |
| | | cell.wrap.drawerPlacement = msg.components[0].wrap.drawerPlacement || 'left' |
| | | } |
| | | |
| | | msg.components[0].search = [] |
| | | msg.components[0].setting.useMSearch = 'true' |
| | | |
| | | msg.components.unshift(cell) |
| | | msg.components[0].$tables = getTables(msg.components[0]) |
| | | msg.components[1].$tables = getTables(msg.components[1]) |
| | | } |
| | | |
| | | try { |
| | | msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) |
| | | } catch (e) { |
| | | console.warn('Stringify Failure') |
| | | msg = '' |
| | | } |
| | | |
| | | let oInput = document.createElement('input') |
| | | oInput.value = msg |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | document.body.removeChild(oInput) |
| | | message.success('复制成功。') |
| | | } |
| | | } |
| | | |
| | | updateLogConfig = (config) => { |
| | | config.fstMenuId = this.state.config.fstMenuId || config.fstMenuId || '' |
| | | config.parentId = this.state.config.parentId || config.parentId || '' |
| | |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '0px 0px 0px 5px'}}>菜单组件 <CopyOutlined onClick={this.copyMenu} style={{marginLeft: '3px', cursor: 'pointer', color: '#1890ff'}} /></Paragraph> |
| | | </> : null} |
| | | </Panel> |
| | | <Panel header="搜索" key="search"> |
| | |
| | | <div className={'menu-view' + (menuloading ? ' saving' : '')}> |
| | | <Card bordered={false} extra={ |
| | | <div className="mk-opeartion-list"> |
| | | {/* <Dropdown overlay={ |
| | | <div className="mk-button-dropdown-wrap"> |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | </div> |
| | | } trigger={['click']} placement="bottomCenter"> |
| | | <Button className="mk-button-more">更多<DownOutlined/></Button> |
| | | </Dropdown> */} |
| | | {config ? <Debug config={config}/> : null} |
| | | {config ? <Transfer config={config}/> : null} |
| | | {config ? <Unattended config={config} updateConfig={this.updateConfig}/> : null} |