king
2023-04-04 a7bb755ee5f797eb390aef581cd9f758d9944f9a
2023-04-04
12个文件已修改
2个文件已添加
276 ■■■■ 已修改文件
public/options.json 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/dragaction/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/formconfig.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/index.jsx 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/actionform/index.jsx 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/dragaction/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/formconfig.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/index.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardcellList/index.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/codemirror/index.jsx 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/codemirror/index.scss 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/codemirror/replaceform/index.jsx 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/codemirror/replaceform/index.scss 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/option.js 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/options.json
@@ -1,12 +1,12 @@
{
  "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": "",
@@ -17,6 +17,6 @@
  "transfer": "false",
  "keepPassword": "true",
  "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"],
  "host": "http://qingqiumarket.cn",
  "service": "MKWMS/"
  "host": "http://demo.mk9h.cn",
  "service": "erp_new/"
}
src/menu/components/card/cardcellcomponent/dragaction/index.jsx
@@ -149,7 +149,7 @@
          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
src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -85,7 +85,7 @@
      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
    },
    {
src/menu/components/card/cardcellcomponent/index.jsx
@@ -458,6 +458,14 @@
            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]
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -552,7 +552,6 @@
      this.record.pageTemplate = ''
      this.record.funcType = ''
      this.record.sqlType = ''
      if (value === 'pop' || value === 'prompt' || value === 'exec') {
        _fieldval.intertype = 'system'
        _fieldval.sqlType = ''
@@ -565,10 +564,10 @@
        _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'
@@ -576,11 +575,12 @@
        _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'
@@ -600,15 +600,6 @@
      } 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') {
src/menu/components/share/actioncomponent/dragaction/index.jsx
@@ -122,7 +122,7 @@
        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
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -1,4 +1,4 @@
import { btnCustomClasses, btnClasses } from '@/utils/option.js'
import { btnClasses } from '@/utils/option.js'
/**
@@ -677,7 +677,7 @@
      tooltip: '此颜色为按钮初始化颜色,可在样式调整中修改。',
      required: false,
      forbid: type === 'datacard' && appType === 'mob', // 移动端,滑动显示的按钮不设置通用颜色
      options: btnCustomClasses
      options: btnClasses
    },
    {
      type: 'radio',
src/menu/components/share/actioncomponent/index.jsx
@@ -379,6 +379,15 @@
              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]
src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -267,6 +267,19 @@
            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]
src/templates/zshare/codemirror/index.jsx
@@ -1,11 +1,12 @@
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'
@@ -33,7 +34,8 @@
    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
@@ -149,9 +151,42 @@
    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
@@ -194,13 +229,15 @@
    )
    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}
@@ -212,6 +249,19 @@
          }}
        /> : 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>
      </>
    )
  }
}
src/templates/zshare/codemirror/index.scss
@@ -37,6 +37,7 @@
    color: #1890ff;
    cursor: pointer;
    transition: opacity 0.3s;
    display: none;
  }
  .anticon-fullscreen-exit:hover {
    opacity: 1;
@@ -45,7 +46,7 @@
    position: fixed;
    z-index: 11;
    right: 10px;
    top: 40px;
    top: 65px;
    font-size: 20px;
    opacity: 0.7;
    color: #1890ff;
@@ -87,6 +88,34 @@
      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;
src/templates/zshare/codemirror/replaceform/index.jsx
New file
@@ -0,0 +1,82 @@
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)
src/templates/zshare/codemirror/replaceform/index.scss
src/utils/option.js
@@ -391,36 +391,6 @@
  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'},