| | |
| | | { |
| | | "appId": "201912040924165801464FF1788654BC5AC73", |
| | | "appkey": "20191106103859640976D6E924E464D029CF0", |
| | | "appId": "202108312122504607B107A83F55B40C98CCF", |
| | | "appkey": "20210831212235413F287EC3BF489424496C8", |
| | | "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", |
| | | "systemType": "", |
| | | "externalDatabase": "", |
| | | "lineColor": "", |
| | | "filter": "false", |
| | | "defaultApp": "mk", |
| | | "defaultApp": "mkindustry", |
| | | "defaultLang": "zh-CN", |
| | | "WXAppID": "", |
| | | "WXminiAppID": "", |
| | |
| | | "transfer": "false", |
| | | "keepPassword": "true", |
| | | "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"], |
| | | "host": "http://qingqiumarket.cn", |
| | | "service": "MKWMS/" |
| | | "host": "http://demo.mk9h.cn", |
| | | "service": "erp_new/" |
| | | } |
| | |
| | | |
| | | if (newcard.OpenType === 'excelIn') { |
| | | newcard.label = item.text |
| | | newcard.class = 'dgreen' |
| | | newcard.class = 'border-dgreen' |
| | | newcard.Ot = 'notRequired' |
| | | } else if (item.subType === 'excelOut') { |
| | | newcard.label = item.text |
| | |
| | | min: 0, |
| | | label: '内容', |
| | | initVal: card.value || '', |
| | | tooltip: '文本类型,会替换内容中的@username@、@fullName@、@mk_city@、@appname@、@bid@。', |
| | | tooltip: '文本类型,会替换内容中的@username@、@fullName@、@mk_city@、@appname@、@bid@、@month@、@week@、@day@', |
| | | required: true |
| | | }, |
| | | { |
| | |
| | | if (res.show === 'link' || res.show === 'icon') { |
| | | style.color = color[cl] |
| | | style.backgroundColor = 'transparent' |
| | | } else if (res.class === 'default') { |
| | | style.color = 'rgba(0, 0, 0, 0.65)' |
| | | style.backgroundColor = '#fff' |
| | | style.borderColor = '#d9d9d9' |
| | | } else if (res.class.indexOf('border') > -1) { |
| | | style.color = color[cl] |
| | | style.backgroundColor = '#fff' |
| | | style.borderColor = color[cl] |
| | | } else { |
| | | style.color = '#ffffff' |
| | | style.backgroundColor = color[cl] |
| | |
| | | this.record.pageTemplate = '' |
| | | this.record.funcType = '' |
| | | this.record.sqlType = '' |
| | | |
| | | if (value === 'pop' || value === 'prompt' || value === 'exec') { |
| | | _fieldval.intertype = 'system' |
| | | _fieldval.sqlType = '' |
| | |
| | | _fieldval.Ot = 'notRequired' |
| | | _fieldval.execSuccess = 'grid' |
| | | _fieldval.label = '导入Excel' |
| | | _fieldval.class = 'dgreen' |
| | | _fieldval.class = 'border-dgreen' |
| | | this.record.Ot = 'notRequired' |
| | | this.record.label = '导入Excel' |
| | | this.record.class = 'dgreen' |
| | | this.record.class = 'border-dgreen' |
| | | this.record.execSuccess = 'grid' |
| | | } else if (value === 'excelOut') { |
| | | _fieldval.intertype = 'system' |
| | |
| | | _fieldval.class = 'dgreen' |
| | | _fieldval.execSuccess = 'never' |
| | | _fieldval.Ot = 'requiredOnce' |
| | | _fieldval.control = '' |
| | | this.record.Ot = 'requiredOnce' |
| | | this.record.label = '导出Excel' |
| | | this.record.class = 'dgreen' |
| | | this.record.execSuccess = 'never' |
| | | |
| | | this.record.control = '' |
| | | } else if (value === 'popview') { |
| | | _fieldval.display = 'modal' |
| | | _fieldval.Ot = 'requiredSgl' |
| | |
| | | } else if (value === 'funcbutton') { |
| | | // _fieldval.funcType = '' |
| | | |
| | | } |
| | | if (value === 'excelIn') { |
| | | _fieldval.label = '导入Excel' |
| | | _fieldval.class = 'dgreen' |
| | | } else if (value === 'excelOut') { |
| | | _fieldval.label = '导出Excel' |
| | | _fieldval.class = 'dgreen' |
| | | _fieldval.control = '' |
| | | this.record.control = '' |
| | | } |
| | | |
| | | if (appType !== 'mob' && _fieldval.Ot === 'notRequired') { |
| | |
| | | |
| | | if (newcard.OpenType === 'excelIn') { |
| | | newcard.label = item.text |
| | | newcard.class = 'dgreen' |
| | | newcard.class = 'border-dgreen' |
| | | newcard.Ot = 'notRequired' |
| | | } else if (newcard.OpenType === 'excelOut') { |
| | | newcard.label = item.text |
| | |
| | | import { btnCustomClasses, btnClasses } from '@/utils/option.js' |
| | | import { btnClasses } from '@/utils/option.js' |
| | | |
| | | |
| | | /** |
| | |
| | | tooltip: '此颜色为按钮初始化颜色,可在样式调整中修改。', |
| | | required: false, |
| | | forbid: type === 'datacard' && appType === 'mob', // 移动端,滑动显示的按钮不设置通用颜色 |
| | | options: btnCustomClasses |
| | | options: btnClasses |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | if (btn.show === 'icon') { |
| | | btn.style.color = color[btn.class] |
| | | btn.style.backgroundColor = 'transparent' |
| | | } else if (btn.class === 'default') { |
| | | btn.style.color = 'rgba(0, 0, 0, 0.65)' |
| | | btn.style.backgroundColor = '#fff' |
| | | btn.style.borderColor = '#d9d9d9' |
| | | } else if (btn.class.indexOf('border') > -1) { |
| | | let _c = btn.class.replace('border-', '') |
| | | btn.style.color = color[_c] |
| | | btn.style.backgroundColor = '#fff' |
| | | btn.style.borderColor = color[_c] |
| | | } else { |
| | | btn.style.color = '#ffffff' |
| | | btn.style.backgroundColor = color[btn.class] |
| | |
| | | let city = sessionStorage.getItem('city') || '' |
| | | let bid = data.$$BID || '' |
| | | val = val.replace(/@username@/ig, userName).replace(/@fullName@/ig, fullName).replace(/@mk_city@/ig, city).replace(/@bid@/ig, bid) |
| | | } else if (/@month@/ig.test(val)) { |
| | | val = val.replace(/@month@/ig, new Date().toLocaleString('en-US', { month: 'long' })) |
| | | } else if (/@week@/ig.test(val)) { |
| | | val = val.replace(/@week@/ig, (() => { |
| | | let day = new Date().getDay() |
| | | let weeks = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'] |
| | | return weeks[day] |
| | | })()) |
| | | } else if (/@day@/ig.test(val)) { |
| | | val = val.replace(/@day@/ig, (() => { |
| | | let day = new Date().getDate() |
| | | return day < 10 ? '0' + day : day |
| | | })()) |
| | | } |
| | | } else if (data.hasOwnProperty(card.field)) { |
| | | val = data[card.field] |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Dropdown, Menu } from 'antd' |
| | | import { FullscreenOutlined, FullscreenExitOutlined, FontSizeOutlined, FormatPainterOutlined } from '@ant-design/icons' |
| | | import { Dropdown, Menu, Modal, notification } from 'antd' |
| | | import { FullscreenOutlined, FullscreenExitOutlined, FontSizeOutlined, FormatPainterOutlined, SwapOutlined } from '@ant-design/icons' |
| | | |
| | | import {UnControlled as CodeMirror} from 'react-codemirror2' |
| | | import sqlFormatter from '@/utils/sqlFormatter.js' |
| | | import ReplaceForm from './replaceform' |
| | | import 'codemirror/mode/javascript/javascript' |
| | | import 'codemirror/mode/sql/sql' |
| | | import 'codemirror/mode/xml/xml' |
| | |
| | | options: null, // mode : text/xml, text/css, text/javascript、text/x-mysql ; theme : cobalt - 黑底 |
| | | fullScreen: false, |
| | | style: {fontSize: '18px', lineHeight: '32px'}, |
| | | display: true |
| | | display: true, |
| | | visible: false |
| | | } |
| | | |
| | | editor = null |
| | |
| | | this.props.onChange(_sql) |
| | | } |
| | | |
| | | submit = () => { |
| | | let _sql = this.state.value |
| | | |
| | | this.ReplaceRef.handleConfirm().then(res => { |
| | | let reg = new RegExp(res.origin, 'ig') |
| | | let times = _sql.match(reg) |
| | | |
| | | if (!times) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未查询到字符《' + res.origin + '》。', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | _sql = _sql.replace(reg, res.value) |
| | | |
| | | this.setState({display: false, defaultVal: _sql}, () => { |
| | | this.setState({display: true}) |
| | | }) |
| | | |
| | | this.props.onChange(_sql) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: `共替换${times.length}处字符《${res.origin}》。`, |
| | | duration: 5 |
| | | }) |
| | | this.setState({ visible: false }) |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { mode, func } = this.props |
| | | const { defaultVal, options, fullScreen, style, display } = this.state |
| | | const { defaultVal, options, fullScreen, style, display, visible } = this.state |
| | | const menu = ( |
| | | <Menu> |
| | | <Menu.Item |
| | |
| | | ) |
| | | |
| | | return ( |
| | | <div className="code-mirror-wrap" style={fullScreen || func ? style : null}> |
| | | {!mode && !fullScreen ? <FormatPainterOutlined onClick={this.handleFormat}/> : null} |
| | | {!fullScreen ? <FullscreenOutlined onClick={this.fullScreenChange}/> : null} |
| | | {fullScreen ? <FullscreenExitOutlined onClick={this.fullScreenChange}/> : null} |
| | | <> |
| | | <div className={'code-mirror-wrap ' + (fullScreen ? 'mk-fullscreen' : '')} style={fullScreen || func ? style : null}> |
| | | {!mode ? <FormatPainterOutlined title="格式化" onClick={this.handleFormat}/> : null} |
| | | <FullscreenOutlined title="最大化" onClick={this.fullScreenChange}/> |
| | | <FullscreenExitOutlined title="向下还原" onClick={this.fullScreenChange}/> |
| | | {fullScreen || func ? <Dropdown overlayClassName="mk-mirror-font" overlay={menu} placement="bottomRight"> |
| | | <FontSizeOutlined /> |
| | | </Dropdown> : null} |
| | | <SwapOutlined title="字符替换" onClick={() => this.setState({visible: true})}/> |
| | | {display ? <CodeMirror |
| | | className="code-mirror-area" |
| | | value={defaultVal} |
| | |
| | | }} |
| | | /> : null} |
| | | </div> |
| | | <Modal |
| | | title="字符替换" |
| | | visible={visible} |
| | | width={500} |
| | | maskClosable={false} |
| | | okText="替换" |
| | | onOk={this.submit} |
| | | onCancel={() => {this.setState({ visible: false })}} |
| | | destroyOnClose |
| | | > |
| | | <ReplaceForm inputSubmit={this.submit} wrappedComponentRef={(inst) => this.ReplaceRef = inst}/> |
| | | </Modal> |
| | | </> |
| | | ) |
| | | } |
| | | } |
| | |
| | | color: #1890ff; |
| | | cursor: pointer; |
| | | transition: opacity 0.3s; |
| | | display: none; |
| | | } |
| | | .anticon-fullscreen-exit:hover { |
| | | opacity: 1; |
| | |
| | | position: fixed; |
| | | z-index: 11; |
| | | right: 10px; |
| | | top: 40px; |
| | | top: 65px; |
| | | font-size: 20px; |
| | | opacity: 0.7; |
| | | color: #1890ff; |
| | |
| | | background: #f5f5f5; |
| | | } |
| | | } |
| | | .anticon-swap { |
| | | position: absolute; |
| | | left: -25px; |
| | | top: 40px; |
| | | color: #13c2c2; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | .code-mirror-wrap.mk-fullscreen { |
| | | .anticon-format-painter { |
| | | position: fixed; |
| | | z-index: 11; |
| | | } |
| | | .anticon-fullscreen-exit { |
| | | display: inline-block; |
| | | } |
| | | .anticon-fullscreen { |
| | | display: none; |
| | | } |
| | | |
| | | .anticon-swap { |
| | | position: fixed; |
| | | z-index: 11; |
| | | left: auto; |
| | | right: 10px; |
| | | top: auto; |
| | | bottom: 20px; |
| | | } |
| | | } |
| | | .mk-mirror-font { |
| | | z-index: 1200!important; |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input } from 'antd' |
| | | // import './index.scss' |
| | | |
| | | class ReplaceForm extends Component { |
| | | static propTpyes = { |
| | | inputSubmit: PropTypes.func // 回车事件 |
| | | } |
| | | |
| | | componentDidMount () { |
| | | try { |
| | | let _form = document.getElementById('origin') |
| | | if (_form && _form.select) { |
| | | _form.select() |
| | | } |
| | | } catch (e) { |
| | | console.warn('Form focusing error!') |
| | | } |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | resolve(values) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | enterPress = (e) => { |
| | | e.stopPropagation() |
| | | |
| | | setTimeout(() => { |
| | | this.props.inputSubmit() |
| | | }, 200) |
| | | } |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 14 } |
| | | } |
| | | } |
| | | return ( |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={24}> |
| | | <Col span={24}> |
| | | <Form.Item label="原字符"> |
| | | {getFieldDecorator('origin', { |
| | | initialValue: '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入原字符!' |
| | | } |
| | | ] |
| | | })(<Input autoComplete="off" onPressEnter={this.enterPress}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label="替换为"> |
| | | {getFieldDecorator('value', { |
| | | initialValue: '' |
| | | })(<Input autoComplete="off" onPressEnter={this.enterPress}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default Form.create()(ReplaceForm) |
| | |
| | | text: '白底紫框' |
| | | }] |
| | | |
| | | // 按钮颜色集 |
| | | export const btnCustomClasses = [{ |
| | | value: 'primary', |
| | | text: '蓝色' |
| | | }, { |
| | | value: 'yellow', |
| | | text: '黄色' |
| | | }, { |
| | | value: 'orange', |
| | | text: '橙色' |
| | | }, { |
| | | value: 'danger', |
| | | text: '红色' |
| | | }, { |
| | | value: 'green', |
| | | text: '绿色' |
| | | }, { |
| | | value: 'dgreen', |
| | | text: '深绿色' |
| | | }, { |
| | | value: 'purple', |
| | | text: '紫色' |
| | | }, { |
| | | value: 'cyan', |
| | | text: '青色' |
| | | }, { |
| | | value: 'gray', |
| | | text: '灰色' |
| | | }] |
| | | |
| | | export const calendarColors = [ |
| | | {name: 'red', value: '#d0021b'}, |
| | | {name: 'orange', value: '#f5a623'}, |