king
2022-08-20 e24c707ba13733903c310334fb0bbee1667ca4f6
2022-08-20
11个文件已修改
2个文件已添加
176 ■■■■ 已修改文件
src/components/encrypts/index.jsx 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/encrypts/index.scss 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/formconfig.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/formaction/formconfig.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardcellList/index.jsx 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/share/normalTable/index.jsx 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.jsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/normalTable/index.jsx 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/encrypts/index.jsx
New file
@@ -0,0 +1,53 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons'
import './index.scss'
class Encryption extends Component {
  static propTpyes = {
    value: PropTypes.any
  }
  state = {
    eye: false
  }
  getValue = () => {
    const { value } = this.props
    let len = value.length
    let val = ''
    if (len === 1) {
      val = '*'
    } else if (len === 2) {
      val = value.substr(0, 1) + '*'
    } else if (len <= 6) {
      val = value.substr(0, 1) + Array(len - 1).join('*') + value.substr(-1)
    } else if (len <= 10) {
      val = value.substr(0, 2) + Array(len - 3).join('*') + value.substr(-2)
    } else if (len === 11) {
      val = value.substr(0, 3) + '****' + value.substr(-4)
    } else {
      let l = Math.floor(len * 0.2)
      val = value.substr(0, l) + Array(len - 1 - 2 * l).join('*') + value.substr(-l)
    }
    return val
  }
  render() {
    const { value } = this.props
    const { eye } = this.state
    return (
      <>
        {eye ? value : this.getValue()}
        {eye ? <EyeOutlined className="mk-open-eye" onClick={() => this.setState({eye: false})}/> : <EyeInvisibleOutlined className="mk-close-eye" onClick={() => this.setState({eye: true})}/>}
      </>
    )
  }
}
export default Encryption
src/components/encrypts/index.scss
New file
@@ -0,0 +1,12 @@
.mk-open-eye {
  color: var(--mk-sys-color);
  cursor: pointer;
  margin-left: 3px!important;
  margin-right: 2px!important;
}
.mk-close-eye {
  color: rgba(0, 0, 0, 0.65);
  cursor: pointer;
  margin-left: 3px!important;
  margin-right: 2px!important;
}
src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -90,7 +90,7 @@
      min: 0,
      label: '内容',
      initVal: card.value || '',
      tooltip: '文本类型,会替换内容中的@username@、@fullName@、@mk_city@、@appname@。',
      tooltip: '文本类型,会替换内容中的@username@、@fullName@、@mk_city@、@appname@、@bid@。',
      required: true
    },
    {
@@ -172,6 +172,7 @@
        { value: 'percent', text: '百分数' },
        { value: 'thdSeparator', text: '千分位' },
        { value: 'abs', text: '绝对值' },
        { value: 'encryption', text: '加密'},
        { value: 'YYYY-MM-DD', text: 'YYYY-MM-DD' },
        { value: 'YYYY-MM-DD HH:mm', text: 'YYYY-MM-DD HH:mm' },
        { value: 'YYYY-MM-DD HH:mm:ss', text: 'YYYY-MM-DD HH:mm:ss' },
src/menu/components/form/formaction/formconfig.jsx
@@ -101,7 +101,7 @@
      type: 'radio',
      key: 'sqlType',
      label: Formdict['header.form.action.type'],
      initVal: card.sqlType || 'update',
      initVal: card.sqlType || '',
      required: true,
      options: [{
        value: 'insert',
src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx
@@ -409,7 +409,7 @@
      initVal: card.format || 'none',
      options: [{
        value: 'none',
        text: Formdict['model.empty']
        text: '无'
      }, {
        value: 'thdSeparator',
        text: '千分位'
@@ -429,7 +429,10 @@
      initVal: card.textFormat || 'none',
      options: [{
        value: 'none',
        text: Formdict['model.empty']
        text: '无'
      }, {
        value: 'encryption',
        text: '加密'
      }, {
        value: 'YYYY-MM-DD',
        text: 'YYYY-MM-DD'
src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx
@@ -226,7 +226,7 @@
      initVal: card.format || 'none',
      options: [{
        value: 'none',
        text: Formdict['model.empty']
        text: '无'
      }, {
        value: 'thdSeparator',
        text: '千分位'
@@ -246,7 +246,10 @@
      initVal: card.textFormat || 'none',
      options: [{
        value: 'none',
        text: Formdict['model.empty']
        text: '无'
      }, {
        value: 'encryption',
        text: '加密'
      }, {
        value: 'YYYY-MM-DD',
        text: 'YYYY-MM-DD'
src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -11,6 +11,7 @@
import MkIcon from '@/components/mk-icon'
import MKEmitter from '@/utils/events.js'
import LostPng from '@/assets/img/lost.png'
import Encrypts from '@/components/encrypts'
import './index.scss'
const { Paragraph } = Typography
@@ -263,11 +264,12 @@
      if (card.datatype === 'static') {
        val = card.value || ''
        if (/@username@|@fullName@|@mk_city@/ig.test(val)) {
        if (/@username@|@fullName@|@mk_city@|@bid@/ig.test(val)) {
          let userName = sessionStorage.getItem('User_Name') || ''
          let fullName = sessionStorage.getItem('Full_Name') || ''
          let city = sessionStorage.getItem('city') || ''
          val = val.replace(/@username@/ig, userName).replace(/@fullName@/ig, fullName).replace(/@mk_city@/ig, 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 (data.hasOwnProperty(card.field)) {
        val = data[card.field]
@@ -338,11 +340,14 @@
      if (val !== '') {
        let orival = val
        if (card.format === 'encryption') {
          val = <Encrypts value={val} />
        }
        if (card.fixStyle === 'alone') {
          let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight}
          val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></>
        } else {
          val = `${card.prefix || ''}${val}${card.postfix || ''}`
          val = <span>{card.prefix || ''}{val}{card.postfix || ''}</span>
        }
        if (card.copyable === 'true') {
          val = <Paragraph copyable={{ text: orival }}>{val}</Paragraph>
src/tabviews/custom/components/share/normalTable/index.jsx
@@ -10,6 +10,7 @@
import MKEmitter from '@/utils/events.js'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import Encrypts from '@/components/encrypts'
import '@/assets/css/table.scss'
import './index.scss'
@@ -122,9 +123,13 @@
          content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)}`
        } else if (col.textFormat === 'YYYY-MM-DD HH:mm:ss' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1]).([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]/.test(content)) {
          content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)} ${content.substr(11, 2)}:${content.substr(14, 2)}:${content.substr(17, 2)}`
        } else if (col.textFormat === 'encryption') {
          content = <span>{col.prefix || ''}<Encrypts value={content} />{col.postfix || ''}</span>
        }
        content = (col.prefix || '') + content + (col.postfix || '')
        if (col.textFormat !== 'encryption') {
          content = (col.prefix || '') + content + (col.postfix || '')
        }
      }
      if (col.marks) {
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -14,6 +14,7 @@
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import CusSwitch from './cusSwitch'
import Encrypts from '@/components/encrypts'
import '@/assets/css/table.scss'
import './index.scss'
@@ -301,9 +302,13 @@
          content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)}`
        } else if (col.textFormat === 'YYYY-MM-DD HH:mm:ss' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1]).([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]/.test(content)) {
          content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)} ${content.substr(11, 2)}:${content.substr(14, 2)}:${content.substr(17, 2)}`
        } else if (col.textFormat === 'encryption') {
          content = <span>{col.prefix || ''}<Encrypts value={content} />{col.postfix || ''}</span>
        }
        content = (col.prefix || '') + content + (col.postfix || '')
        if (col.textFormat !== 'encryption') {
          content = (col.prefix || '') + content + (col.postfix || '')
        }
      }
      if (col.marks) {
@@ -722,9 +727,13 @@
            content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)}`
          } else if (col.textFormat === 'YYYY-MM-DD HH:mm:ss' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1]).([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]/.test(content)) {
            content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)} ${content.substr(11, 2)}:${content.substr(14, 2)}:${content.substr(17, 2)}`
          } else if (col.textFormat === 'encryption') {
            content = <span>{col.prefix || ''}<Encrypts value={content} />{col.postfix || ''}</span>
          }
          content = (col.prefix || '') + content + (col.postfix || '')
          if (col.textFormat !== 'encryption') {
            content = (col.prefix || '') + content + (col.postfix || '')
          }
        }
        if (col.marks) {
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -1557,6 +1557,11 @@
            res.BID = this.props.BID
          }
          if (res.mk_api_key) {
            record.mk_api_key = res.mk_api_key
          }
          delete res.mk_api_key
          this.outerOuterRequest(params, res, record, _resolve)
        }
      } else {
@@ -1620,6 +1625,10 @@
    let param = null
    if (record.mk_api_key) {
      result.mk_api_key = record.mk_api_key
    }
    if (btn.callbackType === 'script' || btn.callbackType === 'default') {
      param = this.getCallBackSql(result, record)
    } else if (btn.callbackType === 'func' || btn.callbackFunc) {
src/tabviews/zshare/mutilform/index.jsx
@@ -273,22 +273,27 @@
        if (item.regular) {
          if (item.regular === 'number') {
            _rules.push({
              pattern: /^[0-9.-]*$/ig,
              pattern: /^[0-9.-]*$/,
              message: formRule.input.numbermsg
            })
          } else if (item.regular === 'letter') {
            _rules.push({
              pattern: /^[a-zA-Z]*$/ig,
              pattern: /^[a-zA-Z]*$/,
              message: formRule.input.lettermsg
            })
          } else if (item.regular === 'letter_number') {
            _rules.push({
              pattern: /^[a-zA-Z0-9]*$/,
              message: '请输入数字或字母'
            })
          } else if (item.regular === 'letter&number') {
            _rules.push({
              pattern: /^[a-zA-Z0-9@_.]*$/ig,
              pattern: /^[a-zA-Z0-9@_.]*$/,
              message: '请输入数字、字母以及@_.'
            })
          } else if (item.regular === 'phone') {
            _rules.push({
              pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/ig,
              pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
              message: '请正确输入手机号'
            })
          } else if (item.regular === 'email') {
@@ -298,7 +303,7 @@
            })
          } else if (item.regular === 'funcname') {
            _rules.push({
              pattern: /^[\u4E00-\u9FA50-9a-zA-Z_]*$/ig,
              pattern: /^[\u4E00-\u9FA50-9a-zA-Z_]*$/,
              message: formRule.input.funcname
            })
          }
src/tabviews/zshare/normalTable/index.jsx
@@ -7,6 +7,7 @@
import asyncComponent from '@/utils/asyncComponent'
import MKEmitter from '@/utils/events.js'
import MkIcon from '@/components/mk-icon'
import Encrypts from '@/components/encrypts'
import '@/assets/css/table.scss'
import './index.scss'
@@ -467,9 +468,13 @@
          content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)}`
        } else if (item.textFormat === 'YYYY-MM-DD HH:mm:ss' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1]).([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]/.test(content)) {
          content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)} ${content.substr(11, 2)}:${content.substr(14, 2)}:${content.substr(17, 2)}`
        } else if (item.textFormat === 'encryption') {
          content = <span>{item.prefix || ''}<Encrypts value={content} />{item.postfix || ''}</span>
        }
  
        content = (item.prefix || '') + content + (item.postfix || '')
        if (item.textFormat !== 'encryption') {
          content = (item.prefix || '') + content + (item.postfix || '')
        }
      }
      
      if (item.marks) {
@@ -865,9 +870,13 @@
              content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)}`
            } else if (col.textFormat === 'YYYY-MM-DD HH:mm:ss' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1]).([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]/.test(content)) {
              content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)} ${content.substr(11, 2)}:${content.substr(14, 2)}:${content.substr(17, 2)}`
            } else if (col.textFormat === 'encryption') {
              content = <span>{col.prefix || ''}<Encrypts value={content} />{col.postfix || ''}</span>
            }
            content = (col.prefix || '') + content + (col.postfix || '')
            if (col.textFormat !== 'encryption') {
              content = (col.prefix || '') + content + (col.postfix || '')
            }
          }
          if (col.marks) {
src/templates/zshare/formconfig.jsx
@@ -1762,10 +1762,10 @@
      type: 'select',
      key: 'format',
      label: Formdict['header.form.format'],
      initVal: card.format || '',
      initVal: card.format || 'none',
      options: [{
        value: '',
        text: Formdict['model.empty']
        value: 'none',
        text: '无'
      }, {
        value: 'thdSeparator',
        text: '千分位'
@@ -1782,10 +1782,13 @@
      type: 'select',
      key: 'textFormat',
      label: Formdict['header.form.format'],
      initVal: card.textFormat || '',
      initVal: card.textFormat || 'none',
      options: [{
        value: '',
        text: Formdict['model.empty']
        value: 'none',
        text: '无'
      }, {
        value: 'encryption',
        text: '加密'
      }, {
        value: 'YYYY-MM-DD',
        text: 'YYYY-MM-DD'
@@ -3013,8 +3016,11 @@
        value: 'letter',
        text: '字母'
      }, {
        value: 'letter_number',
        text: '数字或字母'
      }, {
        value: 'letter&number',
        text: '数字、字母以及_@_.'
        text: '数字、字母以及@_.'
      }, {
        value: 'phone',
        text: '手机号'