New file |
| | |
| | | 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 |
New file |
| | |
| | | .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; |
| | | } |
| | |
| | | min: 0, |
| | | label: '内容', |
| | | initVal: card.value || '', |
| | | tooltip: '文本类型,会替换内容中的@username@、@fullName@、@mk_city@、@appname@。', |
| | | tooltip: '文本类型,会替换内容中的@username@、@fullName@、@mk_city@、@appname@、@bid@。', |
| | | required: true |
| | | }, |
| | | { |
| | |
| | | { 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' }, |
| | |
| | | type: 'radio', |
| | | key: 'sqlType', |
| | | label: Formdict['header.form.action.type'], |
| | | initVal: card.sqlType || 'update', |
| | | initVal: card.sqlType || '', |
| | | required: true, |
| | | options: [{ |
| | | value: 'insert', |
| | |
| | | initVal: card.format || 'none', |
| | | options: [{ |
| | | value: 'none', |
| | | text: Formdict['model.empty'] |
| | | text: '无' |
| | | }, { |
| | | value: 'thdSeparator', |
| | | text: '千分位' |
| | |
| | | initVal: card.textFormat || 'none', |
| | | options: [{ |
| | | value: 'none', |
| | | text: Formdict['model.empty'] |
| | | text: '无' |
| | | }, { |
| | | value: 'encryption', |
| | | text: '加密' |
| | | }, { |
| | | value: 'YYYY-MM-DD', |
| | | text: 'YYYY-MM-DD' |
| | |
| | | initVal: card.format || 'none', |
| | | options: [{ |
| | | value: 'none', |
| | | text: Formdict['model.empty'] |
| | | text: '无' |
| | | }, { |
| | | value: 'thdSeparator', |
| | | text: '千分位' |
| | |
| | | initVal: card.textFormat || 'none', |
| | | options: [{ |
| | | value: 'none', |
| | | text: Formdict['model.empty'] |
| | | text: '无' |
| | | }, { |
| | | value: 'encryption', |
| | | text: '加密' |
| | | }, { |
| | | value: 'YYYY-MM-DD', |
| | | text: 'YYYY-MM-DD' |
| | |
| | | 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 |
| | |
| | | |
| | | 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] |
| | |
| | | |
| | | 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> |
| | |
| | | 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' |
| | | |
| | |
| | | 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) { |
| | |
| | | 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' |
| | | |
| | |
| | | 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) { |
| | |
| | | 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) { |
| | |
| | | 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 { |
| | |
| | | |
| | | 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) { |
| | |
| | | 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') { |
| | |
| | | }) |
| | | } else if (item.regular === 'funcname') { |
| | | _rules.push({ |
| | | pattern: /^[\u4E00-\u9FA50-9a-zA-Z_]*$/ig, |
| | | pattern: /^[\u4E00-\u9FA50-9a-zA-Z_]*$/, |
| | | message: formRule.input.funcname |
| | | }) |
| | | } |
| | |
| | | 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' |
| | | |
| | |
| | | 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) { |
| | |
| | | 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) { |
| | |
| | | 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: '千分位' |
| | |
| | | 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' |
| | |
| | | value: 'letter', |
| | | text: '字母' |
| | | }, { |
| | | value: 'letter_number', |
| | | text: '数字或字母' |
| | | }, { |
| | | value: 'letter&number', |
| | | text: '数字、字母以及_@_.' |
| | | text: '数字、字母以及@_.' |
| | | }, { |
| | | value: 'phone', |
| | | text: '手机号' |