| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Popover, Checkbox, message } from 'antd' |
| | | import { PlusOutlined, PlusSquareOutlined, EditOutlined, FontColorsOutlined, DeleteOutlined, SettingOutlined, ToolOutlined, ClockCircleOutlined } from '@ant-design/icons' |
| | | import { PlusOutlined, PlusSquareOutlined, EditOutlined, FontColorsOutlined, DeleteOutlined, SettingOutlined, ToolOutlined, ClockCircleOutlined, ColumnHeightOutlined } from '@ant-design/icons' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | |
| | | |
| | | return ( |
| | | <div className="menu-balcony-edit-box" style={_style} id={card.uuid}> |
| | | {card.style.height ? <ColumnHeightOutlined className="fixed-height" title="定高" /> : null} |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <PlusOutlined className="plus" title="添加元素" onClick={this.addElement} /> |
| | |
| | | right: -30px; |
| | | font-size: 16px; |
| | | } |
| | | .fixed-height { |
| | | position: absolute; |
| | | bottom: 3px; |
| | | right: 3px; |
| | | font-size: 10px; |
| | | color: orange; |
| | | } |
| | | } |
| | | .menu-balcony-edit-box::after { |
| | | display: block; |
| | |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | | |
| | | const Card = ({ id, card, sort, active, moveCard, findCard, closeCard, selectCard, updateGroup }) => { |
| | | const Card = ({ id, card, sort, labelSize, active, moveCard, findCard, closeCard, selectCard, updateGroup }) => { |
| | | const originalIndex = findCard(id).index |
| | | const [{ isDragging }, drag] = useDrag({ |
| | | item: { type: 'form', id, originalIndex }, |
| | |
| | | updateGroup(_card) |
| | | } |
| | | |
| | | let style = {fontSize: labelSize} |
| | | let s = labelSize * 1.5 + 'px' |
| | | let sortStyle = {width: s, height: s, lineHeight: s, borderRadius: s} |
| | | |
| | | return ( |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | |
| | | </div> |
| | | } trigger="hover"> |
| | | <div className={'page-card ' + (active ? 'active' : '')} onClick={select} style={{ opacity: opacity}}> |
| | | <div ref={node => drag(drop(node))}> |
| | | <span className="form-sort">{sort}</span> |
| | | <div ref={node => drag(drop(node))} style={style}> |
| | | <span className="form-sort" style={sortStyle}>{sort}</span> |
| | | {card.setting.title} |
| | | </div> |
| | | </div> |
| | |
| | | import Card from './card' |
| | | import './index.scss' |
| | | |
| | | const Container = ({list, selectId, tabtype, handleList, handleGroup, closeGroup, selectGroup}) => { |
| | | const Container = ({list, labelSize, selectId, tabtype, handleList, handleGroup, closeGroup, selectGroup}) => { |
| | | const [cards, setCards] = useState(list) |
| | | const moveCard = (id, atIndex) => { |
| | | const { card, index } = findCard(id) |
| | |
| | | id={card.uuid} |
| | | key={card.uuid} |
| | | sort={i + 1} |
| | | labelSize={labelSize} |
| | | active={card.uuid === selectId} |
| | | card={card} |
| | | moveCard={moveCard} |
| | |
| | | display: flex; |
| | | line-height: 30px; |
| | | min-height: 50px; |
| | | font-weight: inherit; |
| | | div { |
| | | font-weight: inherit; |
| | | } |
| | | .page-card { |
| | | position: relative; |
| | | flex: 1; |
| | |
| | | changeStyle = () => { |
| | | const { card } = this.state |
| | | |
| | | MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle) |
| | | MKEmitter.emit('changeStyle', ['height', 'font1', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle) |
| | | } |
| | | |
| | | getStyle = (style) => { |
| | |
| | | render() { |
| | | const { card, group, appType } = this.state |
| | | |
| | | let labelSize = 14 |
| | | if (card.style.fontSize) { |
| | | labelSize = parseInt(card.style.fontSize) |
| | | } |
| | | |
| | | return ( |
| | | <div className="menu-normal-form-edit-box" style={resetStyle(card.style)} onClick={this.clickComponent} id={card.uuid}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | |
| | | </Popover> |
| | | <FormTitle |
| | | list={card.subcards} |
| | | labelSize={labelSize} |
| | | selectId={group ? group.uuid : ''} |
| | | handleList={this.changecards} |
| | | handleGroup={this.changeGroup} |
| | |
| | | top: 1px; |
| | | cursor: pointer; |
| | | padding: 5px; |
| | | color: rgba(0, 0, 0, 0.65); |
| | | background: rgba(255, 255, 255, 0.55); |
| | | } |
| | | |
| | |
| | | } |
| | | .form-area { |
| | | position: relative; |
| | | font-size: 14px; |
| | | .page-card { |
| | | background: transparent; |
| | | } |
| | |
| | | options: [ |
| | | {value: 'show', label: '显示'}, |
| | | {value: 'hidden', label: '隐藏'}, |
| | | ] |
| | | ], |
| | | // controlFields: [ |
| | | // {field: 'labelSize', values: ['show']}, |
| | | // ] |
| | | }, |
| | | // { |
| | | // type: 'number', |
| | | // field: 'labelSize', |
| | | // label: '名称大小', |
| | | // initval: wrap.labelSize || '', |
| | | // tooltip: '分组名称字体大小。', |
| | | // min: 12, |
| | | // max: 50, |
| | | // precision: 0, |
| | | // required: false |
| | | // }, |
| | | { |
| | | type: 'radio', |
| | | field: 'tabtype', |
| | |
| | | changeStyle = () => { |
| | | const { card } = this.state |
| | | |
| | | MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle) |
| | | MKEmitter.emit('changeStyle', ['height', 'font1', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle) |
| | | } |
| | | |
| | | getStyle = (style) => { |
| | |
| | | render() { |
| | | const { card, group, appType } = this.state |
| | | |
| | | let labelSize = 14 |
| | | if (card.style.fontSize) { |
| | | labelSize = parseInt(card.style.fontSize) |
| | | } |
| | | |
| | | return ( |
| | | <div className="menu-normal-form-edit-box" style={resetStyle(card.style)} onClick={this.clickComponent} id={card.uuid}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | |
| | | </Popover> |
| | | <FormTitle |
| | | list={card.subcards} |
| | | labelSize={labelSize} |
| | | tabtype={card.wrap.tabtype || ''} |
| | | selectId={group ? group.uuid : ''} |
| | | handleList={this.changecards} |
| | |
| | | } |
| | | .form-area { |
| | | position: relative; |
| | | font-size: 14px; |
| | | .page-card { |
| | | background: transparent; |
| | | } |
| | |
| | | } else if (_funcType === 'closetab') { |
| | | shows.push('refreshTab') |
| | | } else if (_funcType === 'scan') { |
| | | shows.push('linkmenu') |
| | | shows.push('linkmenu', 'prefix') |
| | | |
| | | reRequired.linkmenu = false |
| | | reTooltip.linkmenu = '使用扫码登录功能或菜单跳转功能时,需选择跳转的菜单。' |
| | |
| | | { value: 'mkUnBinding', text: '用户解绑' }, |
| | | { value: 'mkUnsubscribe', text: '注销账户' }, |
| | | { value: 'reAuth', text: '切换系统(清空缓存-小程序)' }, |
| | | { value: 'clearCache', text: '清空本地配置' }, |
| | | { value: 'copyurl', text: '复制链接地址' }, |
| | | { value: 'logout', text: '退出' }, |
| | | { value: 'goBack', text: '返回' }, |
| | |
| | | options: isApp ? appMenus : menulist |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'prefix', |
| | | label: '前缀', |
| | | initVal: card.prefix || '', |
| | | tooltip: '扫码信息将与前缀拼接后执行。注:跳转菜单需以mkbid开头。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'url', |
| | | label: '页面地址', |
| | |
| | | controlFields: [ |
| | | {field: 'reload', values: ['back']}, |
| | | {field: 'linkmenu', values: ['scan']}, |
| | | {field: 'prefix', values: ['scan']}, |
| | | ], |
| | | span: 24 |
| | | }, |
| | |
| | | options: menulist |
| | | }, |
| | | { |
| | | type: 'text', |
| | | field: 'prefix', |
| | | label: '前缀', |
| | | initval: wrap.prefix || '', |
| | | tooltip: '扫码信息将与前缀拼接后执行。注:跳转菜单需以mkbid开头。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'minishow', |
| | | label: '小程序中', |
| | |
| | | _group = _groups || _group |
| | | } |
| | | |
| | | config.titleStyle = {} |
| | | config.sortStyle = {} |
| | | |
| | | if (config.style.fontSize) { |
| | | let size = parseInt(config.style.fontSize) |
| | | config.titleStyle = {fontSize: size} |
| | | let s = size * 1.5 + 'px' |
| | | config.sortStyle = {width: s, height: s, lineHeight: s, borderRadius: s} |
| | | } |
| | | |
| | | this.setState({ |
| | | sync: _sync, |
| | | data: _data, |
| | |
| | | } |
| | | {config.wrap.groupLabel !== 'hidden' ? <div className="mk-normal-form-title"> |
| | | {config.subcards.map(card => ( |
| | | <div key={card.uuid} className={'form-title' + (card.sort <= step ? ' active' : '')}> |
| | | <span className="form-sort" style={{background: config.wrap.color}}>{card.sort}</span> |
| | | <div key={card.uuid} style={config.titleStyle} className={'form-title' + (card.sort <= step ? ' active' : '')}> |
| | | <span className="form-sort" style={{background: config.wrap.color, ...config.sortStyle}}>{card.sort}</span> |
| | | <span className="before-line" style={{background: config.wrap.color}}></span> |
| | | <span className="after-line" style={{background: config.wrap.color}}></span> |
| | | {card.setting.title} |
| | |
| | | line-height: 30px; |
| | | min-height: 50px; |
| | | margin-bottom: 20px; |
| | | font-weight: inherit; |
| | | .form-title { |
| | | position: relative; |
| | | flex: 1; |
| | | text-align: center; |
| | | font-weight: inherit; |
| | | .form-sort { |
| | | background: #d8d8d8; |
| | | display: block; |
| | |
| | | return group |
| | | }) |
| | | |
| | | config.titleStyle = {} |
| | | |
| | | if (config.style.fontSize) { |
| | | config.titleStyle = {fontSize: parseInt(config.style.fontSize)} |
| | | } |
| | | |
| | | this.setState({ |
| | | sync: _sync, |
| | | data: _data, |
| | |
| | | } |
| | | {config.wrap.groupLabel !== 'hidden' ? <div className={'mk-normal-form-title ' + config.wrap.tabtype}> |
| | | {config.subcards.map(card => ( |
| | | <div key={card.uuid} onClick={() => this.changeGroup(card)} className={'form-title' + (group && group.uuid === card.uuid ? ' active' : '')}> |
| | | <div key={card.uuid} onClick={() => this.changeGroup(card)} style={config.titleStyle} className={'form-title' + (group && group.uuid === card.uuid ? ' active' : '')}> |
| | | {card.setting.title} |
| | | </div>)) |
| | | } |
| | |
| | | min-height: 36px; |
| | | margin-bottom: 20px; |
| | | font-size: 16px; |
| | | font-weight: inherit; |
| | | .form-title { |
| | | position: relative; |
| | | flex: 1; |
| | | text-align: center; |
| | | cursor: pointer; |
| | | font-weight: inherit; |
| | | } |
| | | } |
| | | .mk-normal-form-title.mkbtn { |
| | |
| | | if (!activeItem && Item) { |
| | | this.setBook(Item) |
| | | } else if (Item) { |
| | | const _this = this |
| | | const that = this |
| | | confirm({ |
| | | title: '确定切换账套吗?', |
| | | content: '切换账套时系统需要刷新。', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.setBook(Item, resolve) |
| | | that.setBook(Item, resolve) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | let sid = localStorage.getItem('SessionUid') || '' |
| | | let param = { |
| | | func: 'sPC_TableData_InUpDe', |
| | | LText: `delete tmp_session_show_key where createuserid='${userid}' and createuser='${sid}' and key_type='fcc_years' |
| | | LText: `delete tmp_session_show_key where createuserid='${userid}' and key_type='fcc_years' |
| | | insert into tmp_session_show_key ( key_id,key_type,createuserid,CreateUser,CreateStaff) |
| | | select '${item.id}','fcc_years','${userid}','${sid}','${sessionStorage.getItem('Full_Name') || ''}'`, |
| | | exec_type: 'y' |
| | |
| | | if (item.database === 'sso') { |
| | | let sql = _sso + item.base_sql |
| | | _sso = '' |
| | | |
| | | sql = sql.replace(/@ID@/ig, `'${this.state.ID || ''}'`) |
| | | sql = sql.replace(/@BID@/ig, `'${BID}'`) |
| | | |
| | | if (debug) { |
| | | console.info(sql) |
| | | } |
| | |
| | | } else { |
| | | let sql = _sql + item.base_sql |
| | | _sql = '' |
| | | |
| | | sql = sql.replace(/@ID@/ig, `'${this.state.ID || ''}'`) |
| | | sql = sql.replace(/@BID@/ig, `'${BID}'`) |
| | | |
| | | if (debug) { |
| | | console.info(sql) |
| | | } |
| | |
| | | LText: localItems.join(' union all '), |
| | | obj_name: '', |
| | | arr_field: '', |
| | | table_type: 'Y', |
| | | BID: BID || '', |
| | | ID: this.state.ID || '' |
| | | table_type: 'Y' |
| | | } |
| | | |
| | | if (param.LText) { |
| | |
| | | LText: mainItems.join(' union all '), |
| | | obj_name: '', |
| | | arr_field: '', |
| | | table_type: 'Y', |
| | | BID: BID || '', |
| | | ID: this.state.ID || '' |
| | | table_type: 'Y' |
| | | } |
| | | |
| | | if (mainparam.LText) { |
| | |
| | | func: 'sPC_Get_SelectedList', |
| | | LText: _sql + form.base_sql, |
| | | obj_name: form.field, |
| | | arr_field: form.arr_field, |
| | | BID: this.props.BID || '', |
| | | ID: this.state.ID || '' |
| | | arr_field: form.arr_field |
| | | } |
| | | |
| | | param.LText = param.LText.replace(/@ID@/ig, `'${this.state.ID || ''}'`) |
| | | param.LText = param.LText.replace(/@BID@/ig, `'${this.props.BID || ''}'`) |
| | | |
| | | if (debug) { |
| | | console.info(param.LText) |
| | | } |
| | |
| | | const { config } = this.props |
| | | const { value } = this.state |
| | | |
| | | if (config.inputType === 'password') { |
| | | return <Input.Password ref={this.inputRef} className="mk-form-input" placeholder={config.placeholder || ''} value={value} autoComplete="off" disabled={config.readonly} onChange={this.handleChange} onPressEnter={this.handleInputSubmit}/> |
| | | } |
| | | |
| | | return <Input ref={this.inputRef} className="mk-form-input" allowClear placeholder={config.placeholder || ''} value={value} autoComplete="off" disabled={config.readonly} onChange={this.handleChange} onPressEnter={this.handleInputSubmit} /> |
| | | } |
| | | } |
| | |
| | | .mk-form-input { |
| | | .mk-form-input:not(.ant-input-password) { |
| | | .ant-input-suffix { |
| | | opacity: 0; |
| | | transition: opacity 0.3s; |
| | |
| | | })(<InputNumber min={10} max={2000} precision={0} onPressEnter={this.handleSubmit}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {display === 'dialog' && appType === 'mob' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="小于100时为百分率,大于100时为绝对值。空值时宽度自适应。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 宽度 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('width', { |
| | | initialValue: config.setting.width || '' |
| | | })(<InputNumber min={10} max={2000} precision={0} onPressEnter={this.handleSubmit}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {['dialog', 'drawer', 'modal'].includes(display) ? <Col span={12}> |
| | | <Form.Item label="初始焦点"> |
| | | {getFieldDecorator('focus', { |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'inputType', |
| | | label: '加密显示', |
| | | initVal: card.inputType || 'text', |
| | | required: false, |
| | | options: [{ |
| | | value: 'text', |
| | | text: '否' |
| | | }, { |
| | | value: 'password', |
| | | text: '是' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'interception', |
| | | label: '截取空格', |
| | | initVal: card.interception || 'true', |
| | |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | |
| | | const modalTypeOptions = { |
| | | text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'encryption', 'tooltip', 'extra', 'enter', 'cursor', 'scan', 'splitline', 'placeholder', 'place', 'marginTop', 'marginBottom', 'lenControl'], |
| | | text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'encryption', 'tooltip', 'extra', 'enter', 'cursor', 'scan', 'splitline', 'placeholder', 'place', 'marginTop', 'marginBottom', 'lenControl', 'inputType'], |
| | | number: ['initval', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'splitline', 'place', 'marginTop', 'marginBottom'], |
| | | select: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'setAll', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom', 'empty'], |
| | | checkbox: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'arrange', 'marginTop', 'marginBottom', 'empty'], |
| | |
| | | return value |
| | | } |
| | | |
| | | // /** |
| | | // * @description sql解密 |
| | | // * @return {String} value |
| | | // */ |
| | | // static unFormatOptions (value) { |
| | | // if (!value) return '' |
| | | |
| | | // value = window.atob(value) |
| | | // value = value.replace('minKe', '') |
| | | // value = window.decodeURIComponent(window.atob(value)) |
| | | |
| | | // // 外联数据库替换 |
| | | // if (window.GLOB.externalDatabase !== null && window.GLOB.externalDatabase) { |
| | | // value = value.replace(window.GLOB.externalDatabase, '@db@') |
| | | // } |
| | | |
| | | // value = value.replace(/ mpercent /ig, '%') |
| | | |
| | | // // 替换关键字 |
| | | // formatKeys.forEach(item => { |
| | | // let reg = new RegExp('(\\s)?' + item.value.replace(/\s/g, '') + '(\\s)?', 'ig') |
| | | // value = value.replace(reg, ' ' + item.key + ' ') |
| | | // }) |
| | | |
| | | // // value = value.replace(/\n/ig, ' \n ') |
| | | |
| | | // return value |
| | | // } |
| | | |
| | | /** |
| | | * @description sPC_TableData_InUpDe sql加密 |
| | | * @return {String} value |