| | |
| | | } |
| | | }, |
| | | "caniuse-lite": { |
| | | "version": "1.0.30001643", |
| | | "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz", |
| | | "integrity": "sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg==" |
| | | "version": "1.0.30001690", |
| | | "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001690.tgz", |
| | | "integrity": "sha512-5ExiE3qQN6oF8Clf8ifIDcMRCRE/dMGcETG/XGMD8/XiXm6HXQgQTh1yZYLXXpSOsEUlJm1Xr7kGULZTuGtP/w==" |
| | | }, |
| | | "canvg": { |
| | | "version": "3.0.10", |
| | |
| | | window.GLOB.$error = false |
| | | |
| | | let service = window.GLOB.service ? '-' + window.GLOB.service.replace('/', '') : '' |
| | | let lang = sessionStorage.getItem('lang') !== 'zh-CN' ? sessionStorage.getItem('lang') : '' |
| | | let lang = sessionStorage.getItem('lang') || 'zh-CN' |
| | | lang = lang !== 'zh-CN' ? lang : '' |
| | | let db = `mkdb${service + lang}` |
| | | |
| | | if (window.indexedDB) { |
| | |
| | | } |
| | | } |
| | | |
| | | // 自定义滚动样式 |
| | | .mk-scrollbar { |
| | | overflow-y: auto; |
| | | } |
| | | .mk-scrollbar::-webkit-scrollbar { |
| | | width: 7px; |
| | | } |
| | | .mk-scrollbar::-webkit-scrollbar-thumb { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); |
| | | background: rgba(0, 0, 0, 0.13); |
| | | border-radius: 5px; |
| | | } |
| | | .mk-scrollbar::-webkit-scrollbar-track { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | | background: rgba(0, 0, 0, 0); |
| | | border-radius: 3px; |
| | | } |
| | | |
| | | .ant-modal { |
| | | .ant-radio-group { |
| | | white-space: nowrap; |
| | |
| | | |
| | | // geekblue |
| | | .background.geekblue-1 { |
| | | @include tableBackground(#f0f5ff); |
| | | @include tableBackground(#f0f6ff); |
| | | } |
| | | .background.geekblue-2 { |
| | | @include tableBackground(#d6e4ff); |
| | | @include tableBackground(#dee9ff); |
| | | } |
| | | .background.geekblue-3 { |
| | | @include tableBackground(#adc6ff); |
| | | @include tableBackground(#b5ccff); |
| | | } |
| | | .background.geekblue-4 { |
| | | @include tableBackground(#85a5ff); |
| | | @include tableBackground(#8cadff); |
| | | } |
| | | .background.geekblue-5 { |
| | | @include tableBackground(#597ef7); |
| | | @include tableBackground(#638aff); |
| | | } |
| | | .background.geekblue-6 { |
| | | @include tableBackground(#2f54eb, #ffffff); |
| | | @include tableBackground(#3860f4, #ffffff); |
| | | } |
| | | .background.geekblue-7 { |
| | | @include tableBackground(#1d39c4, #ffffff); |
| | | @include tableBackground(#2544cf, #ffffff); |
| | | } |
| | | .background.geekblue-8 { |
| | | @include tableBackground(#10239e, #ffffff); |
| | | @include tableBackground(#162ca8, #ffffff); |
| | | } |
| | | .background.geekblue-9 { |
| | | @include tableBackground(#061178, #ffffff); |
| | | @include tableBackground(#0a1882, #ffffff); |
| | | } |
| | | .background.geekblue-10 { |
| | | @include tableBackground(#030852, #ffffff); |
| | | @include tableBackground(#060e5c, #ffffff); |
| | | } |
| | | |
| | | // purple |
| | |
| | | |
| | | // geekblue |
| | | .font.geekblue-1 { |
| | | color: #f0f5ff; |
| | | color: #f0f6ff; |
| | | } |
| | | .font.geekblue-2 { |
| | | color: #d6e4ff; |
| | | color: #dee9ff; |
| | | } |
| | | .font.geekblue-3 { |
| | | color: #adc6ff; |
| | | color: #b5ccff; |
| | | } |
| | | .font.geekblue-4 { |
| | | color: #85a5ff; |
| | | color: #8cadff; |
| | | } |
| | | .font.geekblue-5 { |
| | | color: #597ef7; |
| | | color: #638aff; |
| | | } |
| | | .font.geekblue-6 { |
| | | color: #2f54eb; |
| | | color: #3860f4; |
| | | } |
| | | .font.geekblue-7 { |
| | | color: #1d39c4; |
| | | color: #2544cf; |
| | | } |
| | | .font.geekblue-8 { |
| | | color: #10239e; |
| | | color: #162ca8; |
| | | } |
| | | .font.geekblue-9 { |
| | | color: #061178; |
| | | color: #0a1882; |
| | | } |
| | | .font.geekblue-10 { |
| | | color: #030852; |
| | | color: #060e5c; |
| | | } |
| | | |
| | | // purple |
| | |
| | | @include viewstyle(#e6fffb, #b5f5ec, #87e8de, #5cdbd3, #36cfc9, #13c2c2); |
| | | } |
| | | |
| | | // body[class*='mk-blue-purple-'] { |
| | | // --mk-sys-color: #2f54eb; |
| | | // --mk-sys-color1: #f0f5ff; |
| | | // --mk-sys-color2: #d6e4ff; |
| | | // --mk-sys-color3: #adc6ff; |
| | | // --mk-sys-color4: #85a5ff; |
| | | // --mk-sys-color5: #597ef7; |
| | | // @include viewstyle(#f0f5ff, #d6e4ff, #adc6ff, #85a5ff, #597ef7, #2f54eb); |
| | | // } |
| | | body[class*='mk-blue-purple-'] { |
| | | --mk-sys-color: #2f54eb; |
| | | --mk-sys-color1: #f0f5ff; |
| | | --mk-sys-color2: #d6e4ff; |
| | | --mk-sys-color3: #adc6ff; |
| | | --mk-sys-color4: #85a5ff; |
| | | --mk-sys-color5: #597ef7; |
| | | @include viewstyle(#f0f5ff, #d6e4ff, #adc6ff, #85a5ff, #597ef7, #2f54eb); |
| | | --mk-sys-color: #3860f4; |
| | | --mk-sys-color1: #f0f6ff; |
| | | --mk-sys-color2: #dee9ff; |
| | | --mk-sys-color3: #b5ccff; |
| | | --mk-sys-color4: #8cadff; |
| | | --mk-sys-color5: #638aff; |
| | | @include viewstyle(#f0f6ff, #dee9ff, #b5ccff, #8cadff, #638aff, #3860f4); |
| | | } |
| | | |
| | | body[class*='mk-purple-'] { |
| | |
| | | |
| | | try { |
| | | _config = JSON.parse(window.decodeURIComponent(window.atob(_config))) |
| | | |
| | | if (typeof(_config) === 'object' && _config.$srcId) { |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid && _config.$srcId !== srcid) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '当前系统无权限使用此项配置!', |
| | | duration: 5 |
| | | }) |
| | | |
| | | _config = '' |
| | | } else { |
| | | delete _config.$srcId |
| | | } |
| | | } |
| | | } catch (e) { |
| | | // 通过sql语句添加字段集 |
| | | if (/[a-zA-Z0-9_]+\s+(nvarchar\(\d+\)|Decimal\(18,\d+\)|Int|datetime|date)/ig.test(config)) { |
| | |
| | | GLOB.systemType = '' |
| | | GLOB.upStatus = config.updateStatus + '' !== 'false' |
| | | |
| | | if (config.style_appkey) { |
| | | GLOB.style_appkey = config.style_appkey |
| | | } |
| | | |
| | | // GLOB.mainSystemApi = 'https://cloud.positecgroup.com/webapi/dostars' |
| | | |
| | | GLOB.mainSystemApi = 'https://sso.mk9h.cn/cloud/webapi/dostars' |
| | |
| | | MKEmitter.emit('cardAddElement', card.uuid, res) |
| | | } else { |
| | | res.eleType = 'button' |
| | | res.width = typeof(res.width) === 'number' ? res.width : 12 |
| | | res.width = res.width || res.width === 0 ? res.width : 12 |
| | | MKEmitter.emit('cardAddElement', card.uuid, res) |
| | | } |
| | | resolve({status: true}) |
| | |
| | | let btnElement = null |
| | | let _style = resetStyle(card.style) |
| | | |
| | | if (_style.display === 'none') { |
| | | _style.display = 'block' |
| | | } |
| | | |
| | | if (card.OpenType === 'form') { |
| | | if (card.formType === 'switch') { |
| | | btnElement = (<Switch style={_style} className={card.size === 'large' ? 'ant-switch-large' : ''} size={card.size} checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''}/>) |
| | |
| | | _style = {...card.style, opacity: isDragging ? 0.3 : 1} |
| | | _style = resetStyle(_style) |
| | | } |
| | | if (_style.display === 'none') { |
| | | _style.display = 'block' |
| | | } |
| | | if (card.eleType === 'picture' && card.maxWidth) { |
| | | _style.maxWidth = card.maxWidth |
| | | let left = _style.marginLeft || 'auto' |
| | |
| | | copycard.uuid = Utils.getuuid() |
| | | |
| | | try { |
| | | delete _val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | _val.$srcId = srcid |
| | | } |
| | | |
| | | _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) |
| | | } catch (e) { |
| | | console.warn('Stringify Failure') |
| | |
| | | options = ['margin', 'float'] |
| | | } else { |
| | | options.push('width', 'minHeight', 'float') |
| | | if (element.OpenType !== 'form') { |
| | | options.push('display') |
| | | } |
| | | _style.minHeight = _style.minHeight || '28px' |
| | | _style.textAlign = _style.textAlign || 'center' |
| | | } |
| | |
| | | _card.innerHeight = _card.barHeight + (_card.displayValue === 'true' ? fontSize + 2 : 0) |
| | | } else if (_card.eleType === 'button') { // 拆分style |
| | | _card.style = fromJS(style).toJS() |
| | | |
| | | if (_card.OpenType === 'form') { |
| | | delete _card.style.display |
| | | } |
| | | |
| | | if (style.float) { |
| | | _card.wrapStyle = {textAlign: style.float} |
| | |
| | | if (cell.OpenType !== 'form') { |
| | | res.style = {} |
| | | } |
| | | |
| | | if (res.style) { |
| | | delete res.style.display |
| | | } |
| | | // } else if (res.class !== cell.class || res.show !== cell.show || !res.style) { |
| | | } else if (res.class !== cell.class || !res.style) { |
| | | if (res.class) { |
| | |
| | | |
| | | if (element.copyType === 'action') { |
| | | element.eleType = 'button' |
| | | element.width = typeof(element.width) === 'number' ? element.width : 12 |
| | | element.width = element.width || element.width === 0 ? element.width : 12 |
| | | } |
| | | |
| | | element.uuid = _uuid |
| | |
| | | |
| | | if (element.copyType === 'action') { |
| | | element.eleType = 'button' |
| | | element.width = typeof(element.width) === 'number' ? element.width : 12 |
| | | element.width = element.width || element.width === 0 ? element.width : 12 |
| | | } |
| | | |
| | | element.uuid = _uuid |
| | |
| | | yellow_green: '#a0d911', |
| | | green: '#52c41a', |
| | | cyan: '#13c2c2', |
| | | blue_purple: '#2f54eb', |
| | | blue_purple: '#3860f4', |
| | | purple: '#722ed1', |
| | | magenta: '#eb2f96', |
| | | grass_green: '#aeb303', |
| | |
| | | {value: 'no-border', label: '无边框'}, |
| | | {value: 'bold-border', label: '边框加粗'}, |
| | | {value: 'deep-border', label: '边框颜色加深'}, |
| | | {value: 'word-break', label: '强制换行'}, |
| | | ], |
| | | span: 24 |
| | | }, |
| | |
| | | let _val = fromJS(copycard).toJS() |
| | | |
| | | try { |
| | | delete _val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | _val.$srcId = srcid |
| | | } |
| | | |
| | | _val.uuid = Utils.getuuid() |
| | | _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) |
| | | } catch (e) { |
| | |
| | | shows.push('execSuccess', 'execError', 'tipTitle') |
| | | } else if (_funcType === 'mkUnsubscribe' || _funcType === 'reAuth') { |
| | | shows.push('tipTitle') |
| | | } else if (_funcType === 'reSystem') { |
| | | shows.push('tipTitle', 'Ot') |
| | | reOptions.Ot = requireOptions.filter(op => op.value === 'requiredSgl') |
| | | } else if (_funcType === 'closetab') { |
| | | shows.push('refreshTab') |
| | | } else if (_funcType === 'scan') { |
| | |
| | | delete values.extraParam |
| | | } |
| | | |
| | | if (values.refreshTab && values.refreshTab.length && ['pop', 'prompt', 'exec'].includes(values.OpenType) && window.GLOB.customMenu) { |
| | | let id = values.refreshTab[values.refreshTab.length - 1] |
| | | if (id === window.GLOB.customMenu.uuid) { |
| | | if (values.execSuccess !== 'never' || (values.syncComponent && values.syncComponent.length)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '按钮刷新菜单为当前菜单时,成功后的组件刷新(或关闭标签)将失效!', |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | |
| | | copycard.uuid = Utils.getuuid() |
| | | |
| | | try { |
| | | delete _val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | _val.$srcId = srcid |
| | | } |
| | | |
| | | _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) |
| | | } catch (e) { |
| | | console.warn('Stringify Failure') |
| | |
| | | { value: 'mkBinding', text: '开通扫码登录' }, |
| | | { value: 'mkUnBinding', text: '用户解绑' }, |
| | | { value: 'mkUnsubscribe', text: '注销账户' }, |
| | | { value: 'reAuth', text: '切换系统(清空缓存-小程序)' }, |
| | | { value: 'reAuth', text: '切换授权码 / 小程序清空缓存' }, |
| | | { value: 'reSystem', text: '切换系统' }, |
| | | { value: 'clearCache', text: '清空本地配置' }, |
| | | { value: 'copyurl', text: '复制链接地址' }, |
| | | { value: 'expPdf', text: '导出PDF' }, |
| | |
| | | } |
| | | } |
| | | |
| | | if (card.syncComponents && card.syncComponents[0] && Array.isArray(card.syncComponents[0])) { |
| | | card.syncComponents = card.syncComponents.map((item, i) => { |
| | | return { |
| | | syncComId: item, |
| | | label: '', |
| | | uuid: 'fixed' + i |
| | | } |
| | | }) |
| | | } |
| | | |
| | | let forms = [ |
| | | { |
| | | type: 'select', |
| | |
| | | } |
| | | |
| | | btn.updateTime = moment().format('YYYY-MM-DD HH:mm') |
| | | |
| | | if (btn.style) { |
| | | delete btn.style.display |
| | | } |
| | | |
| | | return btn |
| | | } else { |
| | | return item |
| | |
| | | this.transConfig(_val, type) |
| | | |
| | | try { |
| | | delete _val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | _val.$srcId = srcid |
| | | } |
| | | |
| | | _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) |
| | | } catch (e) { |
| | | console.warn(e) |
| | |
| | | let _val = fromJS(copycard).toJS() |
| | | |
| | | try { |
| | | delete _val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | _val.$srcId = srcid |
| | | } |
| | | |
| | | _val.uuid = Utils.getuuid() |
| | | _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) |
| | | } catch (e) { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Radio, Modal } from 'antd' |
| | | import { PaperClipOutlined, DeleteOutlined } from '@ant-design/icons' |
| | | import { Radio, Modal, message } from 'antd' |
| | | import { PaperClipOutlined, DeleteOutlined, CopyOutlined } from '@ant-design/icons' |
| | | |
| | | import InputForm from './inputform' |
| | | import './index.scss' |
| | |
| | | this.props.onChange('') |
| | | } |
| | | |
| | | copyUrl = () => { |
| | | const { url } = this.state |
| | | |
| | | let oInput = document.createElement('input') |
| | | oInput.value = url |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | document.body.removeChild(oInput) |
| | | message.success('复制成功。') |
| | | } |
| | | |
| | | handleChange = (key) => { |
| | | this.setState({visible: key}) |
| | | } |
| | |
| | | {url && type === 'video' ? <div className="mk-source-item-info"> |
| | | <PaperClipOutlined /> |
| | | <a target="_blank" rel="noopener noreferrer" href={url.replace(/@mywebsite@\//ig, window.GLOB.baseurl)}>{name}</a> |
| | | <CopyOutlined title="复制链接" onClick={this.copyUrl}/> |
| | | <DeleteOutlined title="删除文件" onClick={this.deleteUrl}/> |
| | | </div> : null} |
| | | {url && type !== 'video' && url !== '@icon@' ? <div className="mk-source-item-info picture"> |
| | | <img src={url.replace(/@mywebsite@\//ig, window.GLOB.baseurl)} alt="" /> |
| | | <a target="_blank" rel="noopener noreferrer" href={url.replace(/@mywebsite@\//ig, window.GLOB.baseurl)}>{name}</a> |
| | | <CopyOutlined title="复制链接" onClick={this.copyUrl}/> |
| | | <DeleteOutlined title="删除文件" onClick={this.deleteUrl}/> |
| | | </div> : null} |
| | | {url && type !== 'video' && url === '@icon@' ? <div className="mk-source-item-info avatar"> |
| | |
| | | </div> : null} |
| | | <Modal |
| | | visible={!!visible} |
| | | width={visible !== 'system' ? 650 : 1000} |
| | | width={visible !== 'system' ? 650 : 1200} |
| | | closable={false} |
| | | maskClosable={false} |
| | | centered={visible === 'system'} |
| | | okText="确定" |
| | | cancelText="取消" |
| | | onOk={this.popSubmit} |
| | |
| | | cursor: pointer; |
| | | display: none; |
| | | } |
| | | .anticon-copy { |
| | | position: absolute; |
| | | top: 3px; |
| | | right: 30px; |
| | | padding-right: 0px; |
| | | color: #26C281; |
| | | cursor: pointer; |
| | | display: none; |
| | | } |
| | | a { |
| | | display: inline-block; |
| | | width: 100%; |
| | | min-width: 60%; |
| | | max-width: calc(100% - 80px); |
| | | padding-left: 22px; |
| | | padding-right: 14px; |
| | | padding-right: 0px; |
| | | overflow: hidden; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | |
| | | height: 32px; |
| | | line-height: 32px; |
| | | } |
| | | .anticon-delete { |
| | | .anticon-delete, .anticon-copy { |
| | | top: 8px; |
| | | } |
| | | } |
| | | .mk-source-item-info.avatar { |
| | | display: flex; |
| | | top: 0px; |
| | | .anticon-delete { |
| | | .anticon-delete, .anticon-copy { |
| | | top: 8px; |
| | | } |
| | | } |
| | | .mk-source-item-info:hover { |
| | | background-color: #e6f7ff; |
| | | .anticon-delete { |
| | | .anticon-delete, .anticon-copy { |
| | | display: inline-block; |
| | | } |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Input, Form, Row, Col, Pagination, Empty, Button, Modal, notification } from 'antd' |
| | | import { Input, Form, Row, Col, Empty, Button, Modal, notification } from 'antd' |
| | | import { PlusOutlined } from '@ant-design/icons' |
| | | |
| | | import Api from '@/api' |
| | |
| | | const { Search } = Input |
| | | const FileUpload = asyncComponent(() => import('@/tabviews/zshare/fileupload')) |
| | | const Video = asyncComponent(() => import('@/menu/picturecontroller/video')) |
| | | const Image = asyncComponent(() => import('@/components/Image')) |
| | | const EditForm = asyncComponent(() => import('@/menu/picturecontroller/editform')) |
| | | |
| | | class PopSource extends Component { |
| | |
| | | |
| | | state = { |
| | | url: '', |
| | | originlist: [], |
| | | list: [], |
| | | pagelist: [], |
| | | icons: [], |
| | | searchKey: '', |
| | | pageSize: 12, |
| | | pageIndex: 1, |
| | | selectId: '', |
| | | editvisible: false, |
| | | card: null |
| | |
| | | } |
| | | |
| | | init = (originlist) => { |
| | | let list = originlist |
| | | let pagelist = list.filter((item, index) => index < this.state.pageSize) |
| | | const { type } = this.props |
| | | this.setState({list: originlist, icons: window.GLOB.sIcons || [], url: '', searchKey: ''}) |
| | | |
| | | this.setState({originlist, list, url: '', searchKey: '', pageIndex: 1, pagelist}) |
| | | } |
| | | if (type !== 'video' && !window.GLOB.sIcons && sessionStorage.getItem('getIcons') !== 'fail') { |
| | | fetch(window.GLOB.baseurl + 'Content/static/data.json') |
| | | .then(response => response.json()) |
| | | .catch(() => { |
| | | sessionStorage.setItem('getIcons', 'fail') |
| | | }) |
| | | .then(res => { |
| | | if (res && res.list) { |
| | | let icons = [] |
| | | res.list.forEach(item => { |
| | | if (!item.url) return |
| | | |
| | | changeSearch = () => { |
| | | const { originlist, pageSize, searchKey } = this.state |
| | | let list = originlist.filter(item => item.remark.indexOf(searchKey) > -1) |
| | | let pagelist = list.filter((item, index) => index < pageSize) |
| | | icons.push({ |
| | | linkurl: window.GLOB.baseurl + 'Content/static/' + item.url, |
| | | remark: item.remark || '', |
| | | id: Utils.getuuid() |
| | | }) |
| | | }) |
| | | |
| | | this.setState({list, pagelist, pageIndex: 1}) |
| | | window.GLOB.sIcons = icons |
| | | |
| | | this.setState({icons}) |
| | | } else { |
| | | sessionStorage.setItem('getIcons', 'fail') |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | changeValue = (e) => { |
| | | this.setState({url: e.target.value}) |
| | | } |
| | | |
| | | changeSize = (page) => { |
| | | const { list, pageSize } = this.state |
| | | let pagelist = list.filter((item, index) => index < pageSize * page && index >= pageSize * (page - 1)) |
| | | this.setState({pageIndex: page, pagelist}) |
| | | } |
| | | |
| | | changeFile = (val) => { |
| | |
| | | } |
| | | |
| | | selectItem = (item) => { |
| | | const { type } = this.props |
| | | const { icons } = this.state |
| | | |
| | | if (item.linkurl) { |
| | | this.setState({url: item.linkurl, selectId: item.id}) |
| | | if (type !== 'video' && icons.findIndex(n => n.id === item.id) > -1) { |
| | | this.setState({url: item.linkurl.replace(window.GLOB.baseurl, '@mywebsite@/'), selectId: item.id}) |
| | | } else { |
| | | this.setState({url: item.linkurl, selectId: item.id}) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | render () { |
| | | const { type, keyword } = this.props |
| | | const { list, url, pagelist, searchKey, pageIndex, pageSize, selectId, editvisible, card } = this.state |
| | | const { list, icons, url, searchKey, selectId, editvisible, card } = this.state |
| | | |
| | | return ( |
| | | <div className="mk-source-pop-wrap"> |
| | | {keyword === 'input' ? <Form.Item label="地址" help="可使用@mywebsite@代替域名(含虚拟目录),如:@mywebsite@/Content/images/xxx.jpg" labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={{xs: { span: 24 }, sm: { span: 20 }}}> |
| | | if (keyword === 'input') { |
| | | return <div className="mk-source-pop-wrap"> |
| | | <Form.Item label="地址" help="可使用@mywebsite@代替域名(含虚拟目录),如:@mywebsite@/Content/images/xxx.jpg" labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={{xs: { span: 24 }, sm: { span: 20 }}}> |
| | | <TextArea id="source-input" value={url} rows={4} onChange={this.changeValue}/> |
| | | </Form.Item> : null} |
| | | {keyword === 'upload' ? <Form.Item label="上传" labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={{xs: { span: 24 }, sm: { span: 20 }}}> |
| | | </Form.Item> |
| | | </div> |
| | | } else if (keyword === 'upload') { |
| | | return <div className="mk-source-pop-wrap"> |
| | | <Form.Item label="上传" labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={{xs: { span: 24 }, sm: { span: 20 }}}> |
| | | <FileUpload config={{ |
| | | initval: '', |
| | | suffix: type === 'video' ? '.mp4,.webm,.ogg' : '.jpg,.png,.gif,.pjp,.pjpeg,.jpeg,.jfif,.webp,.ico', |
| | | maxfile: 1, |
| | | fileType: type === 'video' ? 'text' : 'picture' |
| | | }} onChange={this.changeFile} /> |
| | | </Form.Item> : null} |
| | | {keyword === 'system' ? |
| | | <Search value={searchKey} placeholder="" onChange={(e) => this.setState({searchKey: e.target.value})} onSearch={this.changeSearch} enterButton/> : null} |
| | | {keyword === 'system' ? <Button className="picture-plus mk-green" onClick={() => this.handleSource({typecharone: type})}> |
| | | </Form.Item> |
| | | </div> |
| | | } |
| | | |
| | | let pagelist = list |
| | | let iconlist = icons |
| | | |
| | | if (searchKey) { |
| | | pagelist = list.filter(item => item.remark && item.remark.indexOf(searchKey) > -1) |
| | | iconlist = icons.filter(item => item.remark && item.remark.indexOf(searchKey) > -1) |
| | | } |
| | | |
| | | return ( |
| | | <div className="mk-source-pop-wrap"> |
| | | <Search value={searchKey} placeholder="" onChange={(e) => this.setState({searchKey: e.target.value})}/> |
| | | <Button className="picture-plus mk-green" onClick={() => this.handleSource({typecharone: type})}> |
| | | <PlusOutlined /> 添加 |
| | | </Button> : null} |
| | | {keyword === 'system' && list.length ? |
| | | <Row gutter={16} style={{minHeight: '250px'}}> |
| | | {pagelist.map(item => ( |
| | | <Col span={4} key={item.id}> |
| | | <div className={'image-video-box' + (selectId === item.id ? ' active' : '')} onClick={() => this.selectItem(item)}> |
| | | <div className="image-video-box-body"> |
| | | {type !== 'video' ? <Image url={item.linkurl} /> : null} |
| | | {type === 'video' ? <Video value={item.linkurl} /> : null} |
| | | </div> |
| | | </Button> |
| | | <Row gutter={16} className="mk-scrollbar"> |
| | | {pagelist.map(item => ( |
| | | <Col span={3} key={item.id}> |
| | | <div className={'image-video-box' + (selectId === item.id ? ' active' : '')} onClick={() => this.selectItem(item)}> |
| | | <div className="image-video-box-body"> |
| | | {type !== 'video' ? <img src={item.linkurl} alt=""/> : <Video value={item.linkurl} />} |
| | | </div> |
| | | </Col> |
| | | ))} |
| | | </Row> : null} |
| | | {keyword === 'system' && list.length === 0 ? <Empty description={null}/> : null} |
| | | {keyword === 'system' && list.length > pageSize ? <Pagination size="small" current={pageIndex} pageSize={pageSize} onChange={this.changeSize} total={list.length} /> : null} |
| | | </div> |
| | | </Col> |
| | | ))} |
| | | {iconlist.length ? <div className="static-source">静态资源</div> : null} |
| | | {iconlist.map(item => ( |
| | | <Col span={3} key={item.id}> |
| | | <div className={'image-video-box' + (selectId === item.id ? ' active' : '')} onClick={() => this.selectItem(item)}> |
| | | <div className="image-video-box-body"> |
| | | <img src={item.linkurl} alt=""/> |
| | | </div> |
| | | </div> |
| | | </Col> |
| | | ))} |
| | | {!pagelist.length && !iconlist.length ? <Empty description={null}/> : null} |
| | | </Row> |
| | | <Modal |
| | | title={'新建'} |
| | | title="新建" |
| | | wrapClassName="picture-edit-model" |
| | | visible={editvisible} |
| | | width={600} |
| | |
| | | .video-react-control-bar { |
| | | display: none; |
| | | } |
| | | img { |
| | | width: 100%; |
| | | height: 100%; |
| | | object-fit: contain; |
| | | object-position: center; |
| | | } |
| | | } |
| | | .image-video-box-body::after { |
| | | content: ''; |
| | |
| | | margin-top: 5px; |
| | | word-break: break-all; |
| | | } |
| | | |
| | | .mk-scrollbar { |
| | | padding: 5px 0px; |
| | | min-height: 300px; |
| | | max-height: calc(100vh - 250px); |
| | | clear: both; |
| | | |
| | | .static-source { |
| | | clear: both; |
| | | padding-left: 10px; |
| | | color: rgba(0, 0, 0, 0.85); |
| | | border-bottom: 1px solid rgba(0, 0, 0, 0.1); |
| | | margin-bottom: 10px; |
| | | } |
| | | } |
| | | } |
| | | .picture-edit-model { |
| | | .ant-modal { |
| | |
| | | if (!cell.eleType) { |
| | | if (cell.copyType === 'action') { |
| | | cell.eleType = 'button' |
| | | cell.width = typeof(cell.width) === 'number' ? cell.width : 12 |
| | | cell.width = cell.width || cell.width === 0 ? cell.width : 12 |
| | | } else { |
| | | cell.eleType = 'text' |
| | | } |
| | |
| | | let val = { |
| | | copyType: 'cols', |
| | | cols: columns.filter(col => !col.origin) |
| | | } |
| | | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | | |
| | | oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) |
| | |
| | | cols: [column] |
| | | } |
| | | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | | |
| | | oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | |
| | | if (!cell.eleType) { |
| | | if (cell.copyType === 'action') { |
| | | cell.eleType = 'button' |
| | | cell.width = typeof(cell.width) === 'number' ? cell.width : 12 |
| | | cell.width = cell.width || cell.width === 0 ? cell.width : 12 |
| | | } else { |
| | | cell.eleType = 'text' |
| | | } |
| | |
| | | let val = { |
| | | copyType: 'editcols', |
| | | cols: columns.filter(col => !col.origin) |
| | | } |
| | | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | | |
| | | oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) |
| | |
| | | cols: [column] |
| | | } |
| | | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | | |
| | | oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | |
| | | if (!cell.eleType) { |
| | | if (cell.copyType === 'action') { |
| | | cell.eleType = 'button' |
| | | cell.width = typeof(cell.width) === 'number' ? cell.width : 12 |
| | | cell.width = cell.width || cell.width === 0 ? cell.width : 12 |
| | | } else { |
| | | cell.eleType = 'text' |
| | | } |
| | |
| | | let val = { |
| | | copyType: 'cols', |
| | | cols: columns.filter(col => !col.origin) |
| | | } |
| | | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | | |
| | | oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) |
| | |
| | | } |
| | | |
| | | let columns = [{ |
| | | Column: 'tb', |
| | | Text: '表名' |
| | | }, { |
| | | Column: 'label', |
| | | Text: '名称' |
| | | }, { |
| | |
| | | let _header = [] |
| | | let _topRow = {} |
| | | let colwidth = [] |
| | | let tbName = setting.tableName || '' |
| | | |
| | | if (window.GLOB.externalDatabase !== null) { |
| | | tbName = tbName.replace(/@db@/ig, window.GLOB.externalDatabase) |
| | | } |
| | | |
| | | columns.forEach(col => { |
| | | _header.push(col.Column) |
| | |
| | | let _row = {} |
| | | |
| | | columns.forEach((col) => { |
| | | let val = item[col.Column] |
| | | _row[col.Column] = val |
| | | if (col.Column === 'tb') { |
| | | _row[col.Column] = tbName |
| | | } else { |
| | | _row[col.Column] = item[col.Column] |
| | | } |
| | | }) |
| | | |
| | | table.push(_row) |
| | |
| | | const wb = XLSX.utils.book_new() |
| | | XLSX.utils.book_append_sheet(wb, ws, 'Sheet1') |
| | | |
| | | XLSX.writeFile(wb, `${setting.tableName || ''}${moment().format('YYYYMMDDHHmmss')}.xlsx`) |
| | | XLSX.writeFile(wb, `${tbName}${moment().format('YYYYMMDDHHmmss')}.xlsx`) |
| | | } |
| | | |
| | | render() { |
| | |
| | | |
| | | arr.push(_key) |
| | | if (_key === 'bid') { |
| | | _val = BID |
| | | _val = `'${BID}'` |
| | | } else { |
| | | _val = `@${_field}` |
| | | } |
| | | |
| | | if (_key === 'bid') { |
| | | _val2 = `' + ${BID} + '` |
| | | _val2 = BID |
| | | } else { |
| | | _val2 = `' + @${_field} + '` |
| | | } |
| | |
| | | _sql += ` |
| | | /* 创建凭证 */ |
| | | exec s_BVoucher_Create |
| | | @Bill ='0', |
| | | @Bill = @${_voucher.linkField}, |
| | | @BVoucherType ='${_voucher.BVoucherType}', |
| | | @VoucherTypeOne ='${_voucher.VoucherTypeOne}', |
| | | @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}', |
| | |
| | | { reg: /@datam@/ig, value: `''` }, |
| | | ] |
| | | |
| | | let process = this.props.config.process === 'true' |
| | | if (process) { |
| | | regs.push({ reg: /@works_flow_code@/ig, value: `'1949-10-01 15:00:00'` }) |
| | | } |
| | | |
| | | let sql = this.formatDataSource(item, regs) |
| | | |
| | | return sql |
| | |
| | | import { SnippetsOutlined } from '@ant-design/icons' |
| | | import md5 from 'md5' |
| | | |
| | | import Utils from '@/utils/utils.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | // import './index.scss' |
| | |
| | | btn.anchors = this.modules[id] || this.modules[_id] || null |
| | | } |
| | | if (btn.syncComponent && btn.syncComponent[0] === 'multiComponent' && btn.syncComponents) { |
| | | if (btn.syncComponents[0] && Array.isArray(btn.syncComponents[0])) { // 兼容问题数据 |
| | | btn.syncComponents = btn.syncComponents.map((item, i) => { |
| | | return { |
| | | syncComId: item, |
| | | label: '', |
| | | uuid: 'fixed' + i |
| | | } |
| | | }) |
| | | } |
| | | |
| | | btn.syncComponents = btn.syncComponents.map(m => { |
| | | let id = m.syncComId[m.syncComId.length - 1] |
| | | let _id = md5(commonId + id) |
| | | |
| | | return this.modules[id] || this.modules[_id] || null |
| | | m.syncComId = this.modules[id] || this.modules[_id] || null |
| | | |
| | | return m.syncComId ? m : null |
| | | }) |
| | | btn.syncComponents = btn.syncComponents.filter(Boolean) |
| | | |
| | |
| | | } |
| | | |
| | | this.pasteFormRef.handleConfirm().then(res => { |
| | | if (!res.copyType) { |
| | | if (!res.copyType || (res.copyType === 'components' && this.props.vType !== res.type)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '配置信息格式错误!', |
| | |
| | | |
| | | let menu = fromJS(window.GLOB.customMenu).toJS() |
| | | |
| | | if (res.copyType === 'components') { |
| | | let commonId = Utils.getuuid() |
| | | |
| | | res.interfaces = res.interfaces.map(inter => { |
| | | inter.uuid = md5(commonId + inter.uuid) |
| | | return inter |
| | | }) |
| | | |
| | | res.components = MenuUtils.resetConfig(res.components, commonId, true) |
| | | |
| | | if (menu.components.length) { |
| | | if ( |
| | | menu.components.findIndex(m => m.type === 'search' || (m.type === 'topbar' && m.wrap.type !== 'navbar')) > -1 && |
| | | res.components.findIndex(m => m.type === 'search' || (m.type === 'topbar' && m.wrap.type !== 'navbar')) > -1 |
| | | ) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '搜索条件不可重复添加!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | if ( |
| | | menu.components.findIndex(m => m.type === 'topbar') > -1 && |
| | | res.components.findIndex(m => m.type === 'topbar') > -1 |
| | | ) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '导航栏不可重复添加!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | |
| | | this.setState({visible: false}) |
| | | |
| | | this.props.insert(res) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '粘贴成功!', |
| | | duration: 2 |
| | | }) |
| | | |
| | | return |
| | | } |
| | | |
| | | if (!options.includes(res.copyType)) { |
| | | if (type && types[res.copyType]) { |
| | | notification.warning({ |
| | |
| | | |
| | | const EditForm = asyncComponent(() => import('./editform')) |
| | | const Video = asyncComponent(() => import('./video')) |
| | | const Image = asyncComponent(() => import('@/components/Image')) |
| | | |
| | | class SourceController extends Component { |
| | | state = { |
| | |
| | | <Col span={4} key={item.id}> |
| | | <div className="image-video-box"> |
| | | <div className="image-video-box-body"> |
| | | <Image url={item.linkurl.replace(/@mywebsite@\//ig, window.GLOB.baseurl)} /> |
| | | <img src={item.linkurl.replace(/@mywebsite@\//ig, window.GLOB.baseurl)} alt=""/> |
| | | </div> |
| | | <div className="image-video-control"> |
| | | <CopyOutlined onClick={() => this.copySource(item)}/> |
| | |
| | | .video-react-control-bar { |
| | | display: none; |
| | | } |
| | | img { |
| | | width: 100%; |
| | | height: 100%; |
| | | object-fit: contain; |
| | | object-position: center; |
| | | } |
| | | } |
| | | .image-video-control { |
| | | position: absolute; |
| | |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} defaultValue={card.display || 'block'} onChange={(e) => this.changeNormalStyle(e.target.value, 'display')}> |
| | | <Radio value="block">块级元素</Radio> |
| | | <Radio value="inline-block">行内块元素</Radio> |
| | | <Radio value="block">整行</Radio> |
| | | <Radio value="inline-block">自适应</Radio> |
| | | <Radio value="none">不显示</Radio> |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | copy = (item) => { |
| | | let msg = { key: 'interface', type: 'line', data: item } |
| | | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | msg.$srcId = srcid |
| | | } |
| | | |
| | | try { |
| | | msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) |
| | | } catch (e) { |
| | |
| | | import './index.scss' |
| | | |
| | | const presetColors = [ |
| | | '#1890ff', '#f5222d', '#fa541c', '#fa8c16', '#faad14', '#fadb14', '#a0d911', '#52c41a', '#13c2c2', '#2f54eb', '#722ed1', |
| | | '#1890ff', '#f5222d', '#fa541c', '#fa8c16', '#faad14', '#fadb14', '#a0d911', '#52c41a', '#13c2c2', '#3860f4', '#722ed1', |
| | | '#eb2f96', '#aeb303', '#c32539', '#1d3661', '#ffd591', '#ffe58f', '#fffb8f', '#eaff8f', '#b7eb8f', '#87e8de', '#91d5ff', |
| | | '#adc6ff', '#EBE9E9', '#d9d9d9', 'rgba(0, 0, 0, 0.65)', 'rgba(0, 0, 0, 0.85)', '#000000', '#ffffff', 'transparent' |
| | | ] |
| | |
| | | |
| | | _card.$copy = true |
| | | |
| | | delete val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | | |
| | | oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | |
| | | }} type={card.setting.icon || 'cloud'}/> |
| | | {card.setting.tip ? <sup className="am-badge-text"></sup> : null} |
| | | </div> : <div className="menu-sign"> |
| | | <img style={{width: card.setting.imgWidth, height: card.setting.imgWidth, borderRadius: card.setting.borderRadius || '15%'}} src={card.setting.url} alt=""/> |
| | | <img style={{width: card.setting.imgWidth, height: card.setting.imgWidth, borderRadius: card.setting.borderRadius || '15%'}} src={card.setting.url.replace(/@mywebsite@\//ig, window.GLOB.baseurl)} alt=""/> |
| | | {card.setting.tip ? <sup className="am-badge-text"></sup> : null} |
| | | </div>} |
| | | <div className="menu-name" style={{opacity: !card.setting.name ? 0 : 1}}>{card.setting.name || '明科'}</div> |
| | |
| | | render() { |
| | | const { card } = this.state |
| | | |
| | | if (!card.wrap) return null |
| | | |
| | | let _style = {...card.style} |
| | | _style.height = card.wrap.height |
| | | |
| | |
| | | label: '标题', |
| | | initval: wrap.title || '', |
| | | // tooltip: '使用搜索框时,标题用于搜索条件隐藏时(当启用黑名单,登录用户无权限时)显示。注:@username代表用户名,@fullname代表姓名。', |
| | | tooltip: '注:@username代表用户名,@fullname代表姓名。', |
| | | tooltip: '注:@username代表用户名,@fullname代表姓名,@appname代表应用名。', |
| | | required: false |
| | | }, |
| | | { |
| | |
| | | let val = JSON.parse(JSON.stringify(_card)) |
| | | val.copyType = 'search' |
| | | |
| | | delete val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | | |
| | | oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | |
| | | let keys = Object.keys(urlparam) |
| | | config.allSqls.forEach(item => { |
| | | item.id = md5(window.GLOB.appkey + item.v_id) |
| | | if (item.type === 'datasource' || item.type === 'excelOut') { |
| | | if (['datasource', 'interface', 'excelOut'].includes(item.type)) { |
| | | item.urlkeys = keys |
| | | item.urlparam = urlparam |
| | | if (config.flow_code) { |
| | |
| | | Utils.initSearchVal(item) |
| | | |
| | | if (urlparam.$searchkey) { |
| | | let reg = new RegExp('(^|,)' + urlparam.$searchkey + '($|,)', 'ig') |
| | | item.search.forEach(cell => { |
| | | if (urlparam.$searchkey === cell.field.toLowerCase() && ['text', 'select', 'link', 'checkcard'].includes(cell.type)) { |
| | | if (reg.test(cell.field) && ['text', 'select', 'link', 'checkcard'].includes(cell.type)) { |
| | | cell.initval = urlparam.$searchval |
| | | } |
| | | }) |
| | |
| | | } |
| | | } else if (cell.syncComponentId === 'multiComponent') { |
| | | let ids = cell.syncComponents.map(m => { |
| | | if (Array.isArray(m)) return m.pop() || '' |
| | | return m.syncComId.pop() || '' |
| | | }) |
| | | |
| | |
| | | |
| | | // 字段透视及必填标志 |
| | | config.search = config.search.map(item => { |
| | | if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param && param.$searchkey === item.field.toLowerCase()) { |
| | | if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param && param.$searchkey === item.field) { |
| | | item.initval = param.$searchval |
| | | } |
| | | return item |
| | |
| | | } |
| | | |
| | | if (card.field) { |
| | | __param.$searchkey = card.field.toLowerCase() |
| | | __param.$searchkey = card.field |
| | | __param.$searchval = data[card.field] || '' |
| | | } |
| | | |
| | |
| | | } |
| | | } else { |
| | | url = data[card.field] || '' |
| | | url = url.replace(/@mywebsite@\//ig, window.GLOB.baseurl) |
| | | } |
| | | |
| | | if (url === '' && card.noValue === 'hide') { // 空值隐藏 |
| | |
| | | yellow_green: '#a0d911', |
| | | green: '#52c41a', |
| | | cyan: '#13c2c2', |
| | | blue_purple: '#2f54eb', |
| | | blue_purple: '#3860f4', |
| | | purple: '#722ed1', |
| | | magenta: '#eb2f96', |
| | | grass_green: '#aeb303', |
| | |
| | | yellow_green: '#a0d911', |
| | | green: '#52c41a', |
| | | cyan: '#13c2c2', |
| | | blue_purple: '#2f54eb', |
| | | blue_purple: '#3860f4', |
| | | purple: '#722ed1', |
| | | magenta: '#eb2f96', |
| | | grass_green: '#aeb303', |
| | |
| | | } |
| | | } |
| | | } |
| | | .custom-braft-editor-box.word-break { |
| | | .braft-content { |
| | | table { |
| | | td, th { |
| | | word-break: break-all!important; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .custom-braft-editor-box.tb-flex { |
| | | .braft-content { |
| | | table { |
| | |
| | | } |
| | | |
| | | if (item.field) { |
| | | __param.$searchkey = item.field.toLowerCase() |
| | | __param.$searchkey = item.field |
| | | __param.$searchval = record[item.field] || '' |
| | | } |
| | | |
| | |
| | | let keys = Object.keys(urlparam) |
| | | config.allSqls.forEach(item => { |
| | | item.id = md5(window.GLOB.appkey + item.v_id) |
| | | if (item.type === 'datasource' || item.type === 'excelOut') { |
| | | if (['datasource', 'interface', 'excelOut'].includes(item.type)) { |
| | | item.urlkeys = keys |
| | | item.urlparam = urlparam |
| | | if (config.flow_code) { |
| | |
| | | Utils.initSearchVal(item) |
| | | |
| | | if (urlparam.$searchkey) { |
| | | let reg = new RegExp('(^|,)' + urlparam.$searchkey + '($|,)', 'ig') |
| | | item.search.forEach(cell => { |
| | | if (urlparam.$searchkey === cell.field.toLowerCase() && ['text', 'select', 'link', 'checkcard'].includes(cell.type)) { |
| | | if (reg.test(cell.field) && ['text', 'select', 'link', 'checkcard'].includes(cell.type)) { |
| | | cell.initval = urlparam.$searchval |
| | | } |
| | | }) |
| | |
| | | } |
| | | } else if (cell.syncComponentId === 'multiComponent') { |
| | | let ids = cell.syncComponents.map(m => { |
| | | if (Array.isArray(m)) return m.pop() || '' |
| | | return m.syncComId.pop() || '' |
| | | }) |
| | | |
| | |
| | | } |
| | | } else if (cell.syncComponentId === 'multiComponent') { |
| | | let ids = cell.syncComponents.map(m => { |
| | | if (Array.isArray(m)) return m.pop() || '' |
| | | return m.syncComId.pop() || '' |
| | | }) |
| | | |
| | |
| | | |
| | | state = { |
| | | loading: true, |
| | | background: sessionStorage.getItem('home_background'), |
| | | background: sessionStorage.getItem('home_background') || 'unset', |
| | | waiting: true, |
| | | view: '' |
| | | } |
| | |
| | | } else { |
| | | let works_flow_countersign = '' |
| | | let works_flow_sign_values = '' |
| | | let works_flow_sign_field = '' |
| | | let works_flow_sign_field = 'statuscharone' |
| | | let works_flow_sign_label = '' |
| | | let works_begin_branch = '' |
| | | if (line.approvalMethod === 'countersign' && node.checkIds.length > 1) { |
| | |
| | | getSysDeclareSql = (btn, formdata, data, columns, BID = '') => { |
| | | const { submitType } = this.state |
| | | |
| | | let datavars = {} // 声明的变量,表单及显示列 |
| | | // 需要声明的变量集 |
| | | let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode', 'roleid', 'mk_departmentcode', 'mk_organization', 'mk_user_type', 'mk_nation', 'mk_province', 'mk_city', 'mk_district', 'mk_address', 'mk_deleted', 'bid', 'mk_submit_type'] |
| | | |
| | |
| | | // 获取字段键值对 |
| | | formdata && formdata.forEach(form => { |
| | | let _key = form.key.toLowerCase() |
| | | datavars[_key] = form.value |
| | | |
| | | if (!_initvars.includes(_key)) { |
| | | _initvars.push(_key) |
| | |
| | | |
| | | // 添加数据中字段,表单值优先(按钮不选行或多行拼接时跳过) |
| | | if (data && btn.Ot !== 'notRequired' && columns && columns.length > 0) { |
| | | datavars = {..._data, ...datavars} |
| | | |
| | | const setField = (col) => { |
| | | if (!col.field) return |
| | | let _key = col.field.toLowerCase() |
| | | |
| | | if (!_initvars.includes(_key)) { |
| | | let _val = datavars.hasOwnProperty(_key) ? datavars[_key] : '' |
| | | let _val = _data.hasOwnProperty(_key) ? _data[_key] : '' |
| | | |
| | | if (col.datatype && /^date/ig.test(col.datatype) && !_val) { |
| | | _val = '1949-10-01' |
| | |
| | | } |
| | | |
| | | let tabId = '' |
| | | let menu = null |
| | | if (btn.refreshTab && btn.refreshTab.length > 0) { |
| | | tabId = btn.refreshTab[btn.refreshTab.length - 1] |
| | | } |
| | |
| | | this.clearBackSqlCache() |
| | | } |
| | | |
| | | if (btn.openmenu && Array.isArray(btn.openmenu) && btn.openmenu.length > 0 && sign !== '@no_target_menu@') { |
| | | let menuId = btn.openmenu.slice(-1)[0] |
| | | if (window.GLOB.mkThdMenus.has(menuId)) { |
| | | menu = {...window.GLOB.mkThdMenus.get(menuId), param: { $BID: id }} |
| | | } else if (btn.MenuID) { |
| | | menu = { |
| | | MenuID: btn.MenuID, |
| | | MenuName: btn.MenuName, |
| | | type: btn.tabType, |
| | | param: { $BID: id } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (tabId && btn.$MenuID === tabId) { // 刷新当前菜单时,停止其他操作 |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | |
| | | if (menu) { |
| | | MKEmitter.emit('modifyTabs', menu, true) |
| | | } |
| | | return |
| | | } |
| | | |
| | |
| | | node && node.scrollIntoView({behavior: 'smooth', block: 'center', inline: 'nearest'}) |
| | | } |
| | | |
| | | if (btn.openmenu && Array.isArray(btn.openmenu) && btn.openmenu.length > 0 && sign !== '@no_target_menu@') { |
| | | let menuId = btn.openmenu.slice(-1)[0] |
| | | let menu = null |
| | | |
| | | if (window.GLOB.mkThdMenus.has(menuId)) { |
| | | menu = {...window.GLOB.mkThdMenus.get(menuId), param: { $BID: id }} |
| | | } else if (btn.MenuID) { |
| | | menu = { |
| | | MenuID: btn.MenuID, |
| | | MenuName: btn.MenuName, |
| | | type: btn.tabType, |
| | | param: { $BID: id } |
| | | } |
| | | } |
| | | |
| | | if (menu) { |
| | | MKEmitter.emit('modifyTabs', menu, true) |
| | | } |
| | | if (menu) { |
| | | MKEmitter.emit('modifyTabs', menu, true) |
| | | } |
| | | |
| | | if (btn.execSuccess === 'popclose' && btn.$tabId) { // 标签关闭刷新 |
| | |
| | | import './index.scss' |
| | | |
| | | const presetColors = [ |
| | | '#f5222d', '#fa541c', '#fa8c16', '#faad14', '#fadb14', '#a0d911', '#52c41a', '#13c2c2', '#1890ff', '#2f54eb', '#722ed1', |
| | | '#f5222d', '#fa541c', '#fa8c16', '#faad14', '#fadb14', '#a0d911', '#52c41a', '#13c2c2', '#1890ff', '#3860f4', '#722ed1', |
| | | '#eb2f96', '#595959', '#ffa39e', '#ffbb96', '#ffd591', '#ffe58f', '#fffb8f', '#eaff8f', '#b7eb8f', '#87e8de', '#91d5ff', |
| | | '#adc6ff', '#d3adf7', '#ffadd2', '#d9d9d9', '#434343', '#000000', '#ffffff', 'transparent' |
| | | ] |
| | |
| | | } |
| | | |
| | | if (item.field) { |
| | | __param.$searchkey = item.field.toLowerCase() |
| | | __param.$searchkey = item.field |
| | | __param.$searchval = record[item.field] || '' |
| | | } |
| | | |
| | |
| | | |
| | | _card.$copy = true |
| | | |
| | | delete val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | | |
| | | oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | |
| | | delete _val.controlField |
| | | delete _val.controlVal |
| | | } |
| | | delete _val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | _val.$srcId = srcid |
| | | } |
| | | |
| | | _val.uuid = Utils.getuuid() |
| | | _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) |
| | |
| | | columns: columnlist |
| | | } |
| | | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | | |
| | | oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | |
| | | let _val = fromJS(copycard).toJS() |
| | | |
| | | try { |
| | | delete _val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | _val.$srcId = srcid |
| | | } |
| | | |
| | | _val.uuid = Utils.getuuid() |
| | | _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) |
| | | } catch (e) { |
| | |
| | | } |
| | | |
| | | try { |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | msg.$srcId = srcid |
| | | } |
| | | |
| | | msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) |
| | | } catch (e) { |
| | | console.warn('Stringify Failure') |
| | |
| | | } |
| | | try { |
| | | _config = JSON.parse(window.decodeURIComponent(window.atob(_config))) |
| | | |
| | | if (typeof(_config) === 'object' && _config.$srcId) { |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid && _config.$srcId !== srcid) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '当前系统无权限使用此项配置!', |
| | | duration: 5 |
| | | }) |
| | | |
| | | _config = '' |
| | | } else { |
| | | delete _config.$srcId |
| | | } |
| | | } |
| | | } catch (e) { |
| | | // 通过sql语句添加字段集 |
| | | if (/[a-zA-Z0-9_]+\s+(nvarchar\(\d+\)|Decimal\(18,\d+\)|Int|datetime|date)/ig.test(values.config)) { |
| | |
| | | |
| | | arr.push(_key) |
| | | if (_key === 'bid') { |
| | | _val = BID |
| | | _val = `'${BID}'` |
| | | } else { |
| | | _val = `@${_field}` |
| | | } |
| | | |
| | | if (_key === 'bid') { |
| | | _val2 = `' + ${BID} + '` |
| | | _val2 = BID |
| | | } else { |
| | | _val2 = `' + @${_field} + '` |
| | | } |
| | |
| | | _sql += ` |
| | | /* 创建凭证 */ |
| | | exec s_BVoucher_Create |
| | | @Bill ='0', |
| | | @Bill = @${_voucher.linkField}, |
| | | @BVoucherType ='${_voucher.BVoucherType}', |
| | | @VoucherTypeOne ='${_voucher.VoucherTypeOne}', |
| | | @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}', |
| | |
| | | |
| | | changeUniques = (uniques) => { |
| | | const { card } = this.props |
| | | const { verify, fields, columnsFields } = this.state |
| | | const { verify, unionFields, columnsFields } = this.state |
| | | |
| | | let _fields = [] |
| | | let change = {} |
| | | if (card.Ot !== 'requiredOnce') { |
| | | _fields = fields |
| | | _fields = unionFields |
| | | } else { |
| | | _fields = columnsFields |
| | | } |
| | |
| | | /> |
| | | <EditTable actions={['move']} data={verify.customverifys} columns={customColumns} onChange={(customverifys) => {this.setState({verify: {...verify, customverifys}})}}/> |
| | | </TabPane> : null} |
| | | {verifyInter === 'system' ? <TabPane tab={ |
| | | {verifyInter === 'system' && (['form', 'pop'].includes(card.OpenType) || !card.OpenType) ? <TabPane tab={ |
| | | <span> |
| | | 单号生成 |
| | | {verify.billcodes.length ? <span className="count-tip">{verify.billcodes.length}</span> : null} |
| | |
| | | /> |
| | | <EditTable actions={['move']} data={verify.billcodes} columns={orderColumns} onChange={(billcodes) => {this.setState({verify: {...verify, billcodes}})}}/> |
| | | </TabPane> : null} |
| | | {verifyInter === 'system' ? <TabPane tab={ |
| | | {verifyInter === 'system' && (card.Ot === 'requiredOnce' || (['form', 'pop'].includes(card.OpenType) || !card.OpenType)) ? <TabPane tab={ |
| | | <span> |
| | | {card.Ot !== 'requiredOnce' ? '唯一性验证' : '同类数据验证'} |
| | | {verify.uniques.length ? <span className="count-tip">{verify.uniques.length}</span> : null} |
| | |
| | | <EditTable actions={['edit', 'move', 'del', 'status', 'sql']} data={verify.uniques} columns={card.Ot !== 'requiredOnce' ? uniqueColumns : onceUniqueColumns} onChange={this.changeUniques}/> |
| | | </TabPane> : null} |
| | | {verifyInter === 'system' ? <TabPane tab={ |
| | | <span> |
| | | <span title={card.Ot === 'requiredOnce' ? '多行拼接时不可用' : ''}> |
| | | 创建凭证 |
| | | {verify.voucher && verify.voucher.enabled ? <span className="count-tip">1</span> : null} |
| | | </span> |
| | | } key="voucher"> |
| | | } key="voucher" disabled={card.Ot === 'requiredOnce'}> |
| | | <VoucherForm |
| | | voucher={voucher} |
| | | columns={columns} |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <Select |
| | | mode="multiple" |
| | | > |
| | | <Select mode="multiple"> |
| | | {fields.map(item => ( |
| | | <Select.Option key={item.uuid} value={item.field}>{item.label}</Select.Option> |
| | | <Select.Option key={item.uuid} value={item.field}>{`${item.label}(${item.field})`}</Select.Option> |
| | | ))} |
| | | </Select> |
| | | )} |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Row, Col, Select, Switch, notification } from 'antd' |
| | | import { Form, Row, Col, Select, Switch, notification, Modal } from 'antd' |
| | | import { ConsoleSqlOutlined } from '@ant-design/icons' |
| | | // import './index.scss' |
| | | |
| | | class UniqueForm extends Component { |
| | |
| | | }) |
| | | } |
| | | |
| | | voucherSql = () => { |
| | | let BVoucherType = this.props.form.getFieldValue('BVoucherType') |
| | | let VoucherTypeOne = this.props.form.getFieldValue('VoucherTypeOne') |
| | | let linkField = this.props.form.getFieldValue('linkField') |
| | | |
| | | let _detail = this.state.voucherDetail.filter(item => item.ModularDetailCode === VoucherTypeOne)[0] |
| | | |
| | | if (!_detail) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '凭证类型或凭证标识不存在!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let _sql = `/* 创建凭证 */ |
| | | exec s_BVoucher_Create |
| | | @Bill = @${linkField || ''}, |
| | | @BVoucherType ='${BVoucherType}', |
| | | @VoucherTypeOne ='${VoucherTypeOne}', |
| | | @VoucherTypeTwo ='${_detail.VoucherTypeTwo}', |
| | | @Type =${_detail.IDefine1}, |
| | | @UserID=@UserID@, |
| | | @Username=@Username, |
| | | @FullName=@FullName, |
| | | @BVoucher =@BVoucher OUTPUT , |
| | | @FIBVoucherDate =@FIBVoucherDate OUTPUT , |
| | | @FiYear =@FiYear OUTPUT , |
| | | @ErrorCode =@ErrorCode OUTPUT, |
| | | @retmsg=@retmsg OUTPUT |
| | | if @ErrorCode!='' |
| | | GOTO aaa |
| | | ` |
| | | |
| | | Modal.info({ |
| | | title: '', |
| | | width: 500, |
| | | className: 'sql-example', |
| | | icon: null, |
| | | content: _sql.split(/\n\s{6}/ig).map((n, index) => <div key={index} dangerouslySetInnerHTML={{ __html: n.replace(/\s/ig, ' ') }} style={{whiteSpace: 'nowrap'}}></div>) |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const { voucherobj } = this.props |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={11}> |
| | | <Form.Item label={'是否启用'}> |
| | | <Form.Item label="是否启用"> |
| | | <Switch checkedChildren="启" unCheckedChildren="停" checked={voucherobj.enabled} onChange={this.onEnabledChange} /> |
| | | {voucherobj.enabled ? <ConsoleSqlOutlined style={{marginLeft: '20px', fontSize: '18px', color: '#1890ff', verticalAlign: 'middle'}} onClick={this.voucherSql}/> : null} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | |
| | | 'blue-8': '#0050b3', |
| | | 'blue-9': '#003a8c', |
| | | 'blue-10': '#002766', |
| | | 'geekblue-1': '#f0f5ff', |
| | | 'geekblue-2': '#d6e4ff', |
| | | 'geekblue-3': '#adc6ff', |
| | | 'geekblue-4': '#85a5ff', |
| | | 'geekblue-5': '#597ef7', |
| | | 'geekblue-6': '#2f54eb', |
| | | 'geekblue-7': '#1d39c4', |
| | | 'geekblue-8': '#10239e', |
| | | 'geekblue-9': '#061178', |
| | | 'geekblue-10': '#030852', |
| | | 'geekblue-1': '#f0f6ff', |
| | | 'geekblue-2': '#dee9ff', |
| | | 'geekblue-3': '#b5ccff', |
| | | 'geekblue-4': '#8cadff', |
| | | 'geekblue-5': '#638aff', |
| | | 'geekblue-6': '#3860f4', |
| | | 'geekblue-7': '#2544cf', |
| | | 'geekblue-8': '#162ca8', |
| | | 'geekblue-9': '#0a1882', |
| | | 'geekblue-10': '#060e5c', |
| | | 'purple-1': '#f9f0ff', |
| | | 'purple-2': '#efdbff', |
| | | 'purple-3': '#d3adf7', |
| | |
| | | card.elements = card.elements.map(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { |
| | | cell.pageTemplate = '' |
| | | cell.linkmenu = '' |
| | | } |
| | | this.resetBtn(cell, commonId) |
| | | this.resetBtn(cell, commonId, clear) |
| | | } else { |
| | | cell.uuid = this.getuuid() |
| | | } |
| | |
| | | card.backElements = card.backElements.map(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { |
| | | cell.pageTemplate = '' |
| | | cell.linkmenu = '' |
| | | } |
| | | this.resetBtn(cell, commonId) |
| | | this.resetBtn(cell, commonId, clear) |
| | | } else { |
| | | cell.uuid = this.getuuid() |
| | | } |
| | |
| | | item.elements = item.elements.map(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { |
| | | cell.pageTemplate = '' |
| | | cell.linkmenu = '' |
| | | } |
| | | this.resetBtn(cell, commonId) |
| | | this.resetBtn(cell, commonId, clear) |
| | | } else { |
| | | cell.uuid = this.getuuid() |
| | | } |
| | |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | |
| | | if (cell.eleType === 'button') { |
| | | if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { |
| | | cell.pageTemplate = '' |
| | | cell.linkmenu = '' |
| | | } |
| | | |
| | | this.resetBtn(cell, commonId) |
| | | this.resetBtn(cell, commonId, clear) |
| | | } |
| | | |
| | | return cell |
| | |
| | | }) |
| | | |
| | | if (cell.subButton) { |
| | | this.resetBtn(cell.subButton, commonId) |
| | | this.resetBtn(cell.subButton, commonId, clear) |
| | | } |
| | | |
| | | return cell |
| | | }) |
| | | } else if (item.type === 'login') { |
| | | if (clear) { |
| | | item.wrap.linkmenu = '' |
| | | } |
| | | } |
| | | |
| | | if (item.btnlog) { |
| | |
| | | item.action = item.action.map(cell => { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | |
| | | if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { |
| | | cell.pageTemplate = '' |
| | | cell.linkmenu = '' |
| | | } |
| | | |
| | | this.resetBtn(cell, commonId) |
| | | this.resetBtn(cell, commonId, clear) |
| | | |
| | | return cell |
| | | }) |
| | |
| | | /** |
| | | * @description 按钮重置 |
| | | */ |
| | | static resetBtn (btn, commonId) { |
| | | static resetBtn (btn, commonId, clear = false) { |
| | | if (btn.OpenType === 'pop' || (btn.OpenType === 'funcbutton' && btn.execMode === 'pop')) { |
| | | if (btn.modal && btn.modal.fields && btn.modal.fields.length > 0) { |
| | | btn.modal.fields = btn.modal.fields.map(m => { |
| | |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (clear) { |
| | | if (btn.pageTemplate === 'linkpage') { |
| | | btn.pageTemplate = '' |
| | | } |
| | | delete btn.linkmenu |
| | | delete btn.openmenu |
| | | delete btn.refreshTab |
| | | } |
| | | |
| | | if (btn.switchTab && btn.switchTab.length > 0) { |
| | | btn.switchTab = btn.switchTab.map(m => md5(commonId + m)) |
| | | } |
| | |
| | | btn.anchors = btn.anchors.map(m => md5(commonId + m)) |
| | | } |
| | | if (btn.syncComponent && btn.syncComponent[0] === 'multiComponent' && btn.syncComponents) { |
| | | if (btn.syncComponents[0] && Array.isArray(btn.syncComponents[0])) { |
| | | btn.syncComponents = btn.syncComponents.map((item, i) => { |
| | | return { |
| | | syncComId: item, |
| | | label: '', |
| | | uuid: 'fixed' + i |
| | | } |
| | | }) |
| | | } |
| | | btn.syncComponents = btn.syncComponents.map(m => { |
| | | m.syncComId = m.syncComId.map(n => { |
| | | if (/\$focus/.test(n)) { |
| | |
| | | _sql += ` |
| | | /* 创建凭证 */ |
| | | exec s_BVoucher_Create |
| | | @Bill ='0', |
| | | @Bill = @${_voucher.linkField}, |
| | | @BVoucherType ='${_voucher.BVoucherType}', |
| | | @VoucherTypeOne ='${_voucher.VoucherTypeOne}', |
| | | @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}', |
| | |
| | | _sql += ` |
| | | /* 工作流异常sql */ |
| | | if @works_flow_error@ != '' |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | begin |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | end |
| | | |
| | | /* 工作流默认sql */ |
| | | insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) |
| | |
| | | _sql += ` |
| | | /* 工作流异常sql */ |
| | | if @works_flow_error@ != '' |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | begin |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | end |
| | | |
| | | if @works_flow_countersign@ = 'Y' |
| | | begin |
| | |
| | | sql += ` |
| | | /* 工作流异常sql */ |
| | | if @works_flow_error@ != '' |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | begin |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | end |
| | | |
| | | /* 工作流默认sql */ |
| | | insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) |
| | |
| | | filterComponent(config.components, _mainSearch) |
| | | |
| | | let keys = sqls.map(item => item.uuid) |
| | | if (keys.length > Array.from(new Set(keys)).length && !window.GLOB.syscheck) { |
| | | if (keys.length > Array.from(new Set(keys)).length) { |
| | | if (window.backend) { |
| | | let m = new Map() |
| | | let n = new Map() |
| | |
| | | let primaryId = param.ID |
| | | let BID = param.BID || '' |
| | | let verify = btn.verify || {} |
| | | let datavars = {} // 声明的变量,表单及显示列 |
| | | let _actionType = null |
| | | let _callbacksql = '' |
| | | |
| | |
| | | // 获取字段键值对 |
| | | formdata && formdata.forEach(form => { |
| | | let _key = form.key.toLowerCase() |
| | | datavars[_key] = form.value |
| | | |
| | | if (!_initvars.includes(_key)) { |
| | | _initvars.push(_key) |
| | |
| | | |
| | | // 添加数据中字段,表单值优先(按钮不选行或多行拼接时跳过) |
| | | if (data && btn.Ot !== 'notRequired' && columns && columns.length > 0) { |
| | | datavars = {..._data, ...datavars} |
| | | |
| | | const setField = (col) => { |
| | | if (!col.field) return |
| | | let _key = col.field.toLowerCase() |
| | | |
| | | if (!_initvars.includes(_key)) { |
| | | let _val = datavars.hasOwnProperty(_key) ? datavars[_key] : '' |
| | | let _val = _data.hasOwnProperty(_key) ? _data[_key] : '' |
| | | |
| | | if (col.datatype && /^date/ig.test(col.datatype) && !_val) { |
| | | _val = '1949-10-01' |
| | |
| | | |
| | | arr.push(_key) |
| | | if (_key === 'bid') { |
| | | _val = BID |
| | | _val = `'${BID}'` |
| | | } else { |
| | | _val = `@${_field}` |
| | | } |
| | | |
| | | if (_key === 'bid') { |
| | | _val2 = `' + ${BID} + '` |
| | | _val2 = BID |
| | | } else { |
| | | _val2 = `' + @${_field} + '` |
| | | } |
| | |
| | | _sql += ` |
| | | /* 创建凭证 */ |
| | | exec s_BVoucher_Create |
| | | @Bill ='${_data[_voucher.linkField.toLowerCase()] || ''}', |
| | | @Bill = @${_voucher.linkField}, |
| | | @BVoucherType ='${_voucher.BVoucherType}', |
| | | @VoucherTypeOne ='${_voucher.VoucherTypeOne}', |
| | | @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}', |
| | |
| | | bg_black_style_yellow_green: {name: '黄绿色', color: '#a0d911'}, |
| | | bg_black_style_green: {name: '绿色', color: '#52c41a'}, |
| | | bg_black_style_cyan: {name: '青色', color: '#13c2c2'}, |
| | | bg_black_style_blue_purple: {name: '蓝紫色', color: '#2f54eb'}, |
| | | bg_black_style_blue_purple: {name: '蓝紫色', color: '#3860f4'}, |
| | | bg_black_style_purple: {name: '紫色', color: '#722ed1'}, |
| | | bg_black_style_magenta: {name: '洋红色', color: '#eb2f96'}, |
| | | bg_black_style_grass_green: {name: '草绿色', color: '#aeb303'}, |
| | |
| | | bg_black_style_yellow_green: {name: '黄绿色', color: '#a0d911'}, |
| | | bg_black_style_green: {name: '绿色', color: '#52c41a'}, |
| | | bg_black_style_cyan: {name: '青色', color: '#13c2c2'}, |
| | | bg_black_style_blue_purple: {name: '蓝紫色', color: '#2f54eb'}, |
| | | bg_black_style_blue_purple: {name: '蓝紫色', color: '#3860f4'}, |
| | | bg_black_style_purple: {name: '紫色', color: '#722ed1'}, |
| | | bg_black_style_magenta: {name: '洋红色', color: '#eb2f96'}, |
| | | bg_black_style_grass_green: {name: '草绿色', color: '#aeb303'}, |
| | |
| | | <Select.Option value="bg_black_style_yellow_green"><span className="color-block" style={{background: '#a0d911'}}></span>黄绿色(#a0d911)</Select.Option> |
| | | <Select.Option value="bg_black_style_green"><span className="color-block" style={{background: '#52c41a'}}></span>绿色(#52c41a)</Select.Option> |
| | | <Select.Option value="bg_black_style_cyan"><span className="color-block" style={{background: '#13c2c2'}}></span>青色(#13c2c2)</Select.Option> |
| | | <Select.Option value="bg_black_style_blue_purple"><span className="color-block" style={{background: '#2f54eb'}}></span>蓝紫色(#2f54eb)</Select.Option> |
| | | <Select.Option value="bg_black_style_blue_purple"><span className="color-block" style={{background: '#3860f4'}}></span>蓝紫色(#3860f4)</Select.Option> |
| | | <Select.Option value="bg_black_style_purple"><span className="color-block" style={{background: '#722ed1'}}></span>紫色(#722ed1)</Select.Option> |
| | | <Select.Option value="bg_black_style_magenta"><span className="color-block" style={{background: '#eb2f96'}}></span>洋红色(#eb2f96)</Select.Option> |
| | | <Select.Option value="bg_black_style_grass_green"><span className="color-block" style={{background: '#aeb303'}}></span>草绿色(#aeb303)</Select.Option> |
| | |
| | | LText: `select '${window.GLOB.appkey}'`, |
| | | } |
| | | |
| | | if (window.GLOB.style_appkey) { |
| | | _param.style_appkey = window.GLOB.style_appkey |
| | | } |
| | | |
| | | _param.userid = result.UserID |
| | | _param.LoginUID = result.LoginUID |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | |
| | | let keys = Object.keys(urlparam) |
| | | config.allSqls.forEach(item => { |
| | | item.id = md5(window.GLOB.appkey + item.v_id) |
| | | if (item.type === 'datasource' || item.type === 'excelOut') { |
| | | if (['datasource', 'interface', 'excelOut'].includes(item.type)) { |
| | | item.urlkeys = keys |
| | | item.urlparam = urlparam |
| | | if (config.flow_code) { |
| | |
| | | } |
| | | |
| | | if (res.query_address !== 'true') { |
| | | localStorage.setItem(_addressUrl, 'false') |
| | | localStorage.removeItem(_addressUrl) |
| | | } else { |
| | | localStorage.setItem(_addressUrl, 'true') |
| | | this.queryAddress() |
| | |
| | | appkey: appkey |
| | | } |
| | | |
| | | if (window.GLOB.style_appkey) { |
| | | _param.style_appkey = window.GLOB.style_appkey |
| | | } |
| | | |
| | | _param.userid = result.UserID |
| | | _param.LoginUID = result.LoginUID |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | |
| | | |
| | | localStorage.setItem(window.GLOB.sysSign + 'pwdlevel', level) |
| | | |
| | | if (res.srcid) { |
| | | localStorage.setItem(window.GLOB.sysSign + 'srcId', res.srcid) |
| | | } else { |
| | | localStorage.removeItem(window.GLOB.sysSign + 'srcId') |
| | | } |
| | | |
| | | sessionStorage.setItem('home_background', res.index_background_color || '') |
| | | res.index_background_color && sessionStorage.setItem('home_background', res.index_background_color) |
| | | |
| | | let seconds = 0 |
| | | if (res.sys_datetime) { |
| | |
| | | UNSAFE_componentWillMount () { |
| | | const { loginWays } = this.props |
| | | let remember = true |
| | | |
| | | if (localStorage.getItem(window.location.href.split('#')[0] + 'users')) { // 过渡 |
| | | localStorage.setItem(window.GLOB.sysSign + 'users', localStorage.getItem(window.location.href.split('#')[0] + 'users')) |
| | | localStorage.setItem(window.GLOB.sysSign + 'remember', localStorage.getItem(window.location.href.split('#')[0] + 'remember')) |
| | | localStorage.removeItem(window.location.href.split('#')[0] + 'users') |
| | | } |
| | | |
| | | if (localStorage.getItem(window.GLOB.sysSign + 'remember') === 'false') { |
| | | remember = false |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import moment from 'moment' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { notification, Modal, Collapse, Card, Switch, Button, Typography, Spin } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons' |
| | | import { notification, Modal, Collapse, Card, Switch, Button, Typography, Spin, message } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, EyeOutlined, EyeInvisibleOutlined, CopyOutlined } from '@ant-design/icons' |
| | | import html2canvas from 'html2canvas' |
| | | import md5 from 'md5' |
| | | |
| | |
| | | insert = (item) => { |
| | | let config = fromJS(this.state.config).toJS() |
| | | |
| | | config.components.push(item) |
| | | if (item.copyType === 'components') { |
| | | config.components.push(...item.components) |
| | | if (!config.interfaces) { |
| | | config.interfaces = item.interfaces |
| | | } else { |
| | | config.interfaces.push(...item.interfaces) |
| | | } |
| | | } else { |
| | | config.components.push(item) |
| | | } |
| | | |
| | | this.setState({config}) |
| | | window.GLOB.customMenu = config |
| | |
| | | const { oriConfig, config } = this.state |
| | | |
| | | return is(fromJS(oriConfig), fromJS(config)) |
| | | } |
| | | |
| | | copyMenu = () => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.enabled) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单未启用,不可复制。', |
| | | duration: 5 |
| | | }) |
| | | } else if (config.components.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未添加组件,不可复制。', |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | | let msg = { copyType: 'components', type: 'admin' } |
| | | |
| | | msg.components = config.components || [] |
| | | msg.interfaces = config.interfaces || [] |
| | | |
| | | try { |
| | | msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) |
| | | } catch (e) { |
| | | console.warn('Stringify Failure') |
| | | msg = '' |
| | | } |
| | | |
| | | let oInput = document.createElement('input') |
| | | oInput.value = msg |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | document.body.removeChild(oInput) |
| | | message.success('复制成功。') |
| | | } |
| | | } |
| | | |
| | | updateLogConfig = (config) => { |
| | |
| | | /> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '15px 0px 0px 37px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '0px 0px 0px 18px'}}>菜单组件:<CopyOutlined onClick={this.copyMenu} style={{cursor: 'pointer', color: '#1890ff'}} /></Paragraph> |
| | | <NormalCss config={config} updateConfig={this.updateConfig}/> |
| | | </> : null} |
| | | </Panel> |
| | |
| | | <SysInterface config={config} updateConfig={this.updateConfig}/> |
| | | <PictureController/> |
| | | <StyleCombControlButton menu={config} /> |
| | | <PasteController insert={this.insert} /> |
| | | <PasteController vType="admin" insert={this.insert} /> |
| | | {config ? <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} /> : null} |
| | | <Button type="primary" id="save-config" disabled={!config} className={needUpdate ? 'update-tip' : ''} onClick={this.submitConfig} loading={menuloading}>保存</Button> |
| | | <Button type="default" disabled={menuloading} onClick={this.closeView}>关闭</Button> |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { notification, Modal, Collapse, Switch, Button, message, Spin, Typography } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, ArrowLeftOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, ArrowLeftOutlined, EyeOutlined, EyeInvisibleOutlined, CopyOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | |
| | |
| | | let _config = fromJS(config).toJS() |
| | | let NavBar = null |
| | | _config.components = _config.components.map(item => { |
| | | if (item.type === 'navbar') { |
| | | if (item.type === 'navbar' && item.wrap) { |
| | | NavBar = fromJS(item).toJS() |
| | | return { |
| | | type: 'navbar', |
| | |
| | | } else if (item.type === 'group') { |
| | | check(item.components, level, sign) |
| | | return |
| | | } else if (item.type === 'navbar' && !item.wrap.MenuNo) { |
| | | } else if (item.type === 'navbar' && item.wrap && !item.wrap.MenuNo) { |
| | | error = `导航栏《${item.name}》未设置菜单参数!` |
| | | } else if (item.type === 'topbar') { |
| | | if (item.wrap.type === 'search' || item.wrap.type === 'searchIcon' || (item.wrap.type === 'navbar' && item.wrap.search === 'true')) { |
| | |
| | | insert = (item) => { |
| | | let config = fromJS(this.state.config).toJS() |
| | | |
| | | if (item.type === 'topbar' && !config.style.paddingTop) { |
| | | config.style.paddingTop = '50px' |
| | | if (item.copyType === 'components') { |
| | | if (item.components.findIndex(m => m.type === 'topbar') > -1 && !config.style.paddingTop) { |
| | | config.style.paddingTop = '50px' |
| | | } |
| | | config.components.push(...item.components) |
| | | if (!config.interfaces) { |
| | | config.interfaces = item.interfaces |
| | | } else { |
| | | config.interfaces.push(...item.interfaces) |
| | | } |
| | | } else { |
| | | if (item.type === 'topbar' && !config.style.paddingTop) { |
| | | config.style.paddingTop = '50px' |
| | | } |
| | | config.components.push(item) |
| | | } |
| | | |
| | | config.components.push(item) |
| | | |
| | | this.setState({config}) |
| | | window.GLOB.customMenu = config |
| | |
| | | return is(fromJS(oriConfig), fromJS(config)) |
| | | } |
| | | |
| | | copyMenu = () => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.enabled) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单未启用,不可复制。', |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | | let msg = { copyType: 'components', type: 'mob' } |
| | | |
| | | msg.components = [] |
| | | msg.interfaces = config.interfaces || [] |
| | | |
| | | config.components.forEach(item => { |
| | | if (item.type === 'navbar') return |
| | | |
| | | msg.components.push(item) |
| | | }) |
| | | |
| | | if (msg.components.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未添加组件,不可复制。', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | try { |
| | | msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) |
| | | } catch (e) { |
| | | console.warn('Stringify Failure') |
| | | msg = '' |
| | | } |
| | | |
| | | let oInput = document.createElement('input') |
| | | oInput.value = msg |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | document.body.removeChild(oInput) |
| | | message.success('复制成功。') |
| | | } |
| | | } |
| | | |
| | | updateLogConfig = (config) => { |
| | | config.open_edition = this.state.config.open_edition || '' |
| | | |
| | |
| | | <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '10px 0px 0px 18px'}} copyable={{ text: `${window.GLOB.baseurl}mob/index.html#/index/${sessionStorage.getItem('kei_no')}/${sessionStorage.getItem('typename')}/${sessionStorage.getItem('lang')}/${MenuId}/@BID@` }}>菜单链接</Paragraph> |
| | | <Paragraph style={{padding: '15px 0px 0px 37px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '0px 0px 0px 23px'}} copyable={{ text: `${window.GLOB.baseurl}mob/index.html#/index/${sessionStorage.getItem('kei_no')}/${sessionStorage.getItem('typename')}/${sessionStorage.getItem('lang')}/${MenuId}/@BID@` }}>菜单链接</Paragraph> |
| | | <Paragraph style={{padding: '0px 0px 0px 18px'}}>菜单组件:<CopyOutlined onClick={this.copyMenu} style={{cursor: 'pointer', color: '#1890ff'}} /></Paragraph> |
| | | <NormalCss config={config} updateConfig={this.updateConfig}/> |
| | | </> : null} |
| | | </Panel> |
| | |
| | | {config ? <Debug config={config}/> : null} |
| | | <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 组件名</Button> |
| | | <CreateView resetmenu={this.getAppMenus} /> |
| | | <PasteController insert={this.insert} /> |
| | | <PasteController vType="mob" insert={this.insert} /> |
| | | <TableNodes config={config} /> |
| | | <ViewNodes config={config} MenuId={MenuId}/> |
| | | <SysInterface config={config} updateConfig={this.updateConfig}/> |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { notification, Modal, Collapse, Switch, Button, message, Spin, Typography } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, ArrowLeftOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, ArrowLeftOutlined, EyeOutlined, EyeInvisibleOutlined, CopyOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | |
| | |
| | | let _config = fromJS(config).toJS() |
| | | let NavBar = null |
| | | _config.components = _config.components.map(item => { |
| | | if (item.type === 'navbar') { |
| | | if (item.type === 'navbar' && item.wrap) { |
| | | NavBar = fromJS(item).toJS() |
| | | return { |
| | | type: 'navbar', |
| | |
| | | insert = (item) => { |
| | | let config = fromJS(this.state.config).toJS() |
| | | |
| | | config.components.push(item) |
| | | if (item.copyType === 'components') { |
| | | config.components.push(...item.components) |
| | | if (!config.interfaces) { |
| | | config.interfaces = item.interfaces |
| | | } else { |
| | | config.interfaces.push(...item.interfaces) |
| | | } |
| | | } else { |
| | | config.components.push(item) |
| | | } |
| | | |
| | | this.setState({config}) |
| | | window.GLOB.customMenu = config |
| | |
| | | return is(fromJS(oriConfig), fromJS(config)) |
| | | } |
| | | |
| | | copyMenu = () => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.enabled) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单未启用,不可复制。', |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | | let msg = { copyType: 'components', type: 'pc' } |
| | | |
| | | msg.components = [] |
| | | msg.interfaces = config.interfaces || [] |
| | | |
| | | config.components.forEach(item => { |
| | | if (item.type === 'navbar') return |
| | | |
| | | msg.components.push(item) |
| | | }) |
| | | |
| | | if (msg.components.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未添加组件,不可复制。', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | try { |
| | | msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) |
| | | } catch (e) { |
| | | console.warn('Stringify Failure') |
| | | msg = '' |
| | | } |
| | | |
| | | let oInput = document.createElement('input') |
| | | oInput.value = msg |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | document.body.removeChild(oInput) |
| | | message.success('复制成功。') |
| | | } |
| | | } |
| | | |
| | | updateLogConfig = (config) => { |
| | | config.open_edition = this.state.config.open_edition || '' |
| | | |
| | |
| | | <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '15px 0px 0px 37px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '0px 0px 0px 18px'}}>菜单组件:<CopyOutlined onClick={this.copyMenu} style={{cursor: 'pointer', color: '#1890ff'}} /></Paragraph> |
| | | <NormalCss config={config} updateConfig={this.updateConfig}/> |
| | | </> : null} |
| | | </Panel> |
| | |
| | | {config ? <Debug config={config}/> : null} |
| | | <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 组件名</Button> |
| | | <CreateView resetmenu={this.getAppMenus} /> |
| | | <PasteController insert={this.insert} /> |
| | | <PasteController vType="pc" insert={this.insert} /> |
| | | <TableNodes config={config} /> |
| | | <ViewNodes config={config} MenuId={MenuId}/> |
| | | <SysInterface config={config} updateConfig={this.updateConfig}/> |
| | |
| | | <Button className="mk-orange" onClick={this.trigger}>过滤菜单</Button> |
| | | <Modal |
| | | title="过滤菜单" |
| | | wrapClassName="mk-scroll-modal" |
| | | visible={visible} |
| | | width={800} |
| | | onOk={this.deletemenu} |
| | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | |
| | | import '@/assets/css/design.scss' |
| | | import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | |
| | | LText: `select '${window.GLOB.appkey}'`, |
| | | } |
| | | |
| | | if (window.GLOB.style_appkey) { |
| | | _param.style_appkey = window.GLOB.style_appkey |
| | | } |
| | | |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) |
| | | |
| | |
| | | |
| | | localStorage.setItem(window.GLOB.sysSign + 'pwdlevel', level) |
| | | |
| | | if (res.srcid) { |
| | | localStorage.setItem(window.GLOB.sysSign + 'srcId', res.srcid) |
| | | } else { |
| | | localStorage.removeItem(window.GLOB.sysSign + 'srcId') |
| | | } |
| | | |
| | | sessionStorage.setItem('home_background', res.index_background_color || '') |
| | | res.index_background_color && sessionStorage.setItem('home_background', res.index_background_color) |
| | | |
| | | let seconds = 0 |
| | | if (res.sys_datetime) { |
| | |
| | | import React, {Component} from 'react' |
| | | import { fromJS } from 'immutable' |
| | | import { Spin, notification, Button, Modal } from 'antd' |
| | | import moment from 'moment' |
| | | import { SwapOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { getAllSqls } from '@/utils/utils-custom.js' |
| | | import './index.scss' |
| | | |
| | | const Header = asyncComponent(() => import('./header')) |
| | |
| | | activeMenu: null, |
| | | remain: 0, |
| | | lackmenus: [], |
| | | lacklinks: [], |
| | | outmenus: [], |
| | | backmenus: [], |
| | | appbackmenus: [], |
| | | btnmenus: [], |
| | | appbtnmenus: [], |
| | | unablemenus: [], |
| | | } |
| | | |
| | | sqlmap = null |
| | | btnmap = null |
| | | allMenus = [] |
| | | appMenus = {} |
| | | |
| | | // delete _val.controlField 删除按钮控制字段 |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | document.body.className = '' |
| | | window.GLOB.syscheck = true |
| | | } |
| | | |
| | | componentDidMount() { |
| | |
| | | remain: 0, |
| | | menulist: [], |
| | | lackmenus: [], |
| | | lacklinks: [], |
| | | outmenus: [], |
| | | backmenus: [], |
| | | appbackmenus: [], |
| | | btnmenus: [], |
| | | appbtnmenus: [], |
| | | unablemenus: [], |
| | | loading: true |
| | | }) |
| | | |
| | | this.allMenus = [] |
| | | Api.getCloudConfig({func: 's_get_pc_menus', systemType: window.GLOB.sysType, debug: 'Y'}).then(result => { |
| | | if (result.status) { |
| | | let menulist = [] |
| | |
| | | fst.snd_menu.forEach(snd => { |
| | | if (snd.trd_menu) { |
| | | snd.trd_menu.forEach(trd => { |
| | | this.allMenus.push(trd.MenuID) |
| | | |
| | | if (trd.PageParam) { |
| | | let pass = false |
| | | try { |
| | |
| | | }) |
| | | } else { |
| | | this.sqlmap = new Map() |
| | | this.btnmap = new Map() |
| | | |
| | | let errlist = sessionStorage.getItem('syscheck_main') |
| | | errlist = errlist ? JSON.parse(errlist) : null |
| | |
| | | remain: 0, |
| | | menulist: [], |
| | | lackmenus: [], |
| | | lacklinks: [], |
| | | outmenus: [], |
| | | backmenus: [], |
| | | appbackmenus: [], |
| | | btnmenus: [], |
| | | appbtnmenus: [], |
| | | unablemenus: [], |
| | | loading: true |
| | | }) |
| | | |
| | | this.allMenus = [] |
| | | this.appMenus = {} |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (result.status) { |
| | | let applist = [] |
| | |
| | | app.status = true |
| | | app.menus = [] |
| | | |
| | | this.appMenus[app.ID] = [] |
| | | |
| | | result.menus.forEach(m => { |
| | | this.appMenus[app.ID].push(m.MenuID) |
| | | |
| | | if (m.menus_rolelist) { |
| | | try { |
| | | let pageParam = JSON.parse(window.decodeURIComponent(window.atob(m.menus_rolelist))) |
| | |
| | | if (m.type === 'navbar') return |
| | | } |
| | | delete m.menus_rolelist |
| | | m.$pid = app.ID |
| | | |
| | | app.menus.push(m) |
| | | }) |
| | |
| | | }) |
| | | } else { |
| | | this.sqlmap = new Map() |
| | | this.btnmap = new Map() |
| | | |
| | | let errlist = sessionStorage.getItem('syscheck_app') |
| | | errlist = errlist ? JSON.parse(errlist) : null |
| | |
| | | } |
| | | |
| | | getMenuParam = (menus) => { |
| | | const { lackmenus, outmenus, unablemenus, backmenus, appbackmenus, stop } = this.state |
| | | const { lackmenus, lacklinks, outmenus, unablemenus, backmenus, appbackmenus, btnmenus, appbtnmenus, stop } = this.state |
| | | |
| | | let menu = menus.shift() |
| | | |
| | |
| | | MenuID: menu.MenuID |
| | | } |
| | | |
| | | let appType = 'admin' |
| | | if (menu.kei_no) { |
| | | param.TypeCharOne = menu.kei_no |
| | | param.typename = menu.typename |
| | | param.lang = menu.lang |
| | | |
| | | appType = 'pc' |
| | | if (['pad', 'mob'].includes(menu.typename)) { |
| | | appType = 'mob' |
| | | } |
| | | |
| | | this.allMenus = this.appMenus[menu.$pid] || [] |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | } else if (!config.enabled) { |
| | | this.setState({unablemenus: [...unablemenus, menu]}) |
| | | } else { |
| | | let sqls = getAllSqls(config) |
| | | let keys = sqls.map(item => item.uuid) |
| | | let sqls = [] |
| | | let btns = [] |
| | | let links = [] |
| | | |
| | | if (keys.length > Array.from(new Set(keys)).length) { |
| | | this.setState({backmenus: [...backmenus, menu]}) |
| | | } else { |
| | | let repeat = false |
| | | let premenu = null |
| | | sqls.forEach(item => { |
| | | if (this.sqlmap.has(item.uuid)) { |
| | | window.mkInfo(item) |
| | | if (repeat) return |
| | | repeat = true |
| | | premenu = this.sqlmap.get(item.uuid) |
| | | } else { |
| | | this.sqlmap.set(item.uuid, menu) |
| | | } |
| | | this.getAllSqls(config, appType, sqls, btns, links) |
| | | |
| | | if (links.length) { |
| | | links.forEach(item => { |
| | | window.mkInfo(menu.pName + ':' + item) |
| | | }) |
| | | if (premenu) { |
| | | this.setState({appbackmenus: [...appbackmenus, [premenu, menu]]}) |
| | | this.setState({lacklinks: [...lacklinks, menu]}) |
| | | } |
| | | |
| | | if (sqls.length) { |
| | | let keys = sqls.map(item => item.uuid) |
| | | |
| | | if (keys.length > Array.from(new Set(keys)).length) { |
| | | this.setState({backmenus: [...backmenus, menu]}) |
| | | } else { |
| | | let repeat = false |
| | | let premenu = null |
| | | sqls.forEach(item => { |
| | | if (this.sqlmap.has(item.uuid)) { |
| | | window.mkInfo(item) |
| | | if (repeat) return |
| | | repeat = true |
| | | premenu = this.sqlmap.get(item.uuid) |
| | | } else { |
| | | this.sqlmap.set(item.uuid, menu) |
| | | } |
| | | }) |
| | | if (premenu) { |
| | | this.setState({appbackmenus: [...appbackmenus, [premenu, menu]]}) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (btns.length) { |
| | | let keys = btns.map(item => item.uuid) |
| | | if (keys.length > Array.from(new Set(keys)).length) { |
| | | this.setState({btnmenus: [...btnmenus, menu]}) |
| | | } else { |
| | | let repeat = false |
| | | let premenu = null |
| | | btns.forEach(item => { |
| | | if (this.btnmap.has(item.uuid)) { |
| | | window.mkInfo(item) |
| | | if (repeat) return |
| | | repeat = true |
| | | premenu = this.btnmap.get(item.uuid) |
| | | } else { |
| | | this.btnmap.set(item.uuid, menu) |
| | | } |
| | | }) |
| | | if (premenu) { |
| | | this.setState({appbtnmenus: [...appbtnmenus, [premenu, menu]]}) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | getAllSqls = (config, appType, sqls, btns, links) => { |
| | | let filterComponent = (components, label = '') => { |
| | | components.forEach(item => { |
| | | item.$menuname = (config.MenuName || '') + label + '-' + (item.name || '') |
| | | |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | filterComponent(tab.components, label) |
| | | }) |
| | | } else if (item.type === 'group') { |
| | | filterComponent(item.components, label) |
| | | } else { |
| | | if (item.wrap && item.setting) { |
| | | if (item.wrap.datatype === 'public' || item.wrap.datatype === 'static') { |
| | | item.setting.interType = 'other' |
| | | } |
| | | } |
| | | |
| | | if (appType === 'mob' && item.type !== 'search' && item.type !== 'topbar' && item.search && item.search.length > 0) { |
| | | item.search = [] |
| | | } |
| | | if (appType !== 'mob' && item.search && item.search.length > 0) { |
| | | item.search.forEach(cell => { |
| | | if (['select', 'link', 'multiselect', 'checkcard', 'radio'].includes(cell.type) && cell.resourceType === '1' && cell.dataSource) { |
| | | sqls.push({uuid: md5(item.uuid + cell.uuid), type: 'sForm', LText: `${item.$menuname}-${cell.label}(搜索)`}) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (item.subtype === 'tablecard') { // 兼容 |
| | | item.type = 'card' |
| | | } |
| | | |
| | | if (item.setting && item.setting.interType === 'system') { |
| | | item.setting.$name = item.$menuname || '' |
| | | |
| | | sqls.push({uuid: item.uuid, type: 'datasource', LText: item.setting.$name}) |
| | | } |
| | | |
| | | item.action && item.action.forEach(cell => { |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | |
| | | btns.push({uuid: cell.uuid, label: cell.logLabel}) |
| | | |
| | | if (cell.hidden === 'true') return false |
| | | |
| | | resetButton(item, cell) |
| | | }) |
| | | |
| | | if (item.type === 'table') { |
| | | let getCols = (cols) => { |
| | | cols.forEach(col => { |
| | | if (col.type === 'action') { |
| | | col.type = 'custom' |
| | | } |
| | | if (col.type === 'colspan') { |
| | | getCols(col.subcols || []) |
| | | } else if (col.type === 'custom') { |
| | | col.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') { |
| | | resetElement(item, cell) |
| | | return |
| | | } |
| | | |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | |
| | | btns.push({uuid: cell.uuid, label: cell.logLabel}) |
| | | |
| | | if (cell.hidden === 'true') return |
| | | |
| | | resetButton(item, cell) |
| | | }) |
| | | } else if (item.subtype === 'editable' && col.editable === 'true') { |
| | | if (col.editType === 'select' && col.resourceType === '1') { |
| | | sqls.push({uuid: col.uuid, type: 'tbForm', LText: `${item.$menuname}-${col.label}(列表单)`}) |
| | | } else if (col.editType === 'popSelect') { |
| | | if (col.pops) { |
| | | col.pops.forEach(n => { |
| | | sqls.push({uuid: n.uuid, type: 'popSource', LText: `${item.$menuname}-${col.label}(列表单)`}) |
| | | }) |
| | | } else { |
| | | sqls.push({uuid: col.uuid, type: 'popSource', LText: `${item.$menuname}-${col.label}(列表单)`}) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | getCols(item.cols) |
| | | |
| | | if (item.subtype === 'editable' && item.submit.intertype === 'system') { |
| | | item.submit.logLabel = item.$menuname + '-提交' |
| | | |
| | | sqls.push({uuid: 'submit_' + item.uuid, type: 'editable', LText: item.submit.logLabel}) |
| | | } |
| | | } else if (['card', 'carousel', 'timeline'].includes(item.type)) { |
| | | item.subcards && item.subcards.forEach(card => { |
| | | if (card.setting.click === 'menu' && card.setting.menu) { |
| | | if (appType === 'admin') { |
| | | if (!Array.isArray(card.setting.menu)) { |
| | | links.push(item.$menuname) |
| | | } else { |
| | | let menuId = card.setting.menu.slice(-1)[0] |
| | | if (!this.allMenus.includes(menuId)) { |
| | | links.push(item.$menuname) |
| | | } |
| | | } |
| | | } else { |
| | | if (typeof(card.setting.menu) !== 'string') { |
| | | links.push(item.$menuname) |
| | | } else if (!this.allMenus.includes(card.setting.menu)) { |
| | | links.push(item.$menuname) |
| | | } |
| | | } |
| | | } else if (card.setting.click === 'menus' && card.menus && card.menus.length > 0) { |
| | | if (appType === 'admin') { |
| | | card.menus.forEach(m => { |
| | | if (!m.MenuID || !this.allMenus.includes(m.MenuID)) { |
| | | links.push(item.$menuname) |
| | | } |
| | | }) |
| | | } else { |
| | | card.menus.forEach(m => { |
| | | if (typeof(m.menu) !== 'string' || !this.allMenus.includes(m.menu)) { |
| | | links.push(item.$menuname) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | card.elements && card.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') { |
| | | resetElement(item, cell) |
| | | return |
| | | } |
| | | |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | |
| | | btns.push({uuid: cell.uuid, label: cell.logLabel}) |
| | | |
| | | if (cell.hidden === 'true') return |
| | | |
| | | resetButton(item, cell) |
| | | }) |
| | | |
| | | if (!card.backElements || card.backElements.length === 0) return |
| | | |
| | | card.backElements.forEach(cell => { |
| | | if (cell.eleType !== 'button') { |
| | | resetElement(item, cell) |
| | | return |
| | | } |
| | | |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | |
| | | btns.push({uuid: cell.uuid, label: cell.logLabel}) |
| | | |
| | | if (cell.hidden === 'true') return |
| | | |
| | | resetButton(item, cell) |
| | | }) |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | | item.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') { |
| | | resetElement(item, cell) |
| | | return |
| | | } |
| | | |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | |
| | | btns.push({uuid: cell.uuid, label: cell.logLabel}) |
| | | |
| | | if (cell.hidden === 'true') return |
| | | |
| | | resetButton(item, cell) |
| | | }) |
| | | } else if (item.type === 'form') { |
| | | item.subcards.forEach(group => { |
| | | group.subButton.OpenType = 'formSubmit' |
| | | group.subButton.uuid = group.uuid |
| | | group.subButton.modal = { |
| | | fields: group.fields |
| | | } |
| | | |
| | | group.subButton.logLabel = item.$menuname + '-' + group.subButton.label |
| | | |
| | | btns.push({uuid: group.uuid, label: group.subButton.logLabel}) |
| | | |
| | | resetButton(item, group.subButton) |
| | | }) |
| | | } else if (item.type === 'module' && item.subtype === 'invoice') { |
| | | if (item.buyer.setting && item.buyer.setting.interType === 'system') { |
| | | sqls.push({uuid: item.uuid + 'buyer', type: 'datasource', LText: item.$menuname + '-buyer'}) |
| | | } |
| | | |
| | | if (item.detail.setting && item.detail.setting.interType === 'system') { |
| | | sqls.push({uuid: item.uuid + 'detail', type: 'datasource', LText: item.$menuname + '-detail'}) |
| | | } |
| | | |
| | | sqls.push({uuid: item.uuid + item.billSaveBtn.type, type: 'button', LText: item.$menuname + '-' + item.billSaveBtn.label}) |
| | | |
| | | sqls.push({uuid: item.uuid + item.billOutBtn.type, type: 'button', LText: item.$menuname + '-' + item.billOutBtn.label}) |
| | | |
| | | sqls.push({uuid: item.uuid + 'billback', type: 'btnCallBack', LText: item.$menuname + '-' + item.billOutBtn.label + '(回调)'}) |
| | | } else if (item.type === 'menubar') { |
| | | item.subMenus.forEach(cell => { |
| | | if (cell.setting.type === 'menu') { |
| | | if (!this.allMenus.includes(cell.uuid)) { |
| | | links.push(item.$menuname + '-' + cell.setting.name) |
| | | } |
| | | } else if (cell.setting.type === 'linkmenu') { |
| | | if (!this.allMenus.includes(cell.setting.linkMenuId)) { |
| | | links.push(item.$menuname + '-' + cell.setting.name) |
| | | } |
| | | } |
| | | }) |
| | | } else if (item.type === 'login') { |
| | | if (!item.wrap.linkmenu || !this.allMenus.includes(item.wrap.linkmenu)) { |
| | | links.push(item.$menuname) |
| | | } |
| | | } else if (item.type === 'topbar') { |
| | | if (item.wrap.menus) { |
| | | item.wrap.menus.forEach(m => { |
| | | if (!this.allMenus.includes(m.menu)) { |
| | | links.push(item.$menuname) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | let resetElement = (item, cell) => { |
| | | if (cell.linkmenu && cell.linkmenu.length) { |
| | | if (appType === 'admin') { |
| | | if (!Array.isArray(cell.linkmenu)) { |
| | | links.push(item.$menuname) |
| | | } else { |
| | | let menuId = cell.linkmenu.slice(-1)[0] |
| | | if (!this.allMenus.includes(menuId)) { |
| | | links.push(item.$menuname) |
| | | } |
| | | } |
| | | } else { |
| | | if (cell.linkmenu !== 'goback' && (typeof(cell.linkmenu) !== 'string' || !this.allMenus.includes(cell.linkmenu))) { |
| | | links.push(item.$menuname) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | let resetButton = (item, cell) => { |
| | | if (['exec', 'prompt', 'pop', 'form', 'formSubmit'].includes(cell.OpenType)) { |
| | | if (cell.intertype === 'system' || cell.procMode === 'system') { // 系统接口 |
| | | sqls.push({uuid: cell.uuid, type: 'button', LText: cell.logLabel}) |
| | | } |
| | | if (cell.callbackType === 'script' && cell.verify && cell.verify.cbScripts) { |
| | | sqls.push({uuid: 'back_' + cell.uuid, type: 'btnCallBack', LText: cell.logLabel}) |
| | | } |
| | | if (['pop', 'formSubmit'].includes(cell.OpenType) && cell.modal && cell.modal.fields) { |
| | | cell.modal.fields.forEach(form => { |
| | | // 数据源sql语句,预处理,权限黑名单字段设置为隐藏表单 |
| | | if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(form.type) && form.resourceType === '1') { |
| | | sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'form', LText: `${cell.logLabel}-${form.label}(表单)`}) |
| | | } else if (form.type === 'popSelect') { |
| | | sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'popSource', LText: `${cell.logLabel}-${form.label}(表单)`}) |
| | | } |
| | | }) |
| | | } |
| | | } else if (cell.OpenType === 'excelIn') { |
| | | if (cell.intertype === 'system') { |
| | | sqls.push({uuid: cell.uuid, type: 'excelIn', LText: cell.logLabel}) |
| | | } |
| | | } else if (cell.OpenType === 'excelOut') { |
| | | if (cell.intertype === 'system' && cell.verify && cell.verify.dataType === 'custom') { |
| | | sqls.push({uuid: cell.uuid, type: 'excelOut', LText: cell.logLabel || ''}) |
| | | } else if (cell.intertype === 'system' && cell.verify && item.setting && item.setting.interType === 'system') { |
| | | if (appType === 'mob') { |
| | | cell.pagination = 'false' |
| | | } |
| | | if (item.subtype === 'dualdatacard' || item.setting.laypage !== cell.pagination) { |
| | | sqls.push({uuid: cell.uuid, type: 'excelOut', LText: cell.logLabel || ''}) |
| | | } |
| | | } |
| | | } else if (cell.OpenType === 'funcbutton') { |
| | | if (cell.funcType === 'print') { |
| | | if (cell.intertype === 'system' && cell.verify && cell.verify.dataType === 'custom') { |
| | | sqls.push({uuid: cell.uuid, type: 'print', LText: cell.logLabel || ''}) |
| | | } |
| | | if (cell.execMode === 'pop' && cell.modal && cell.modal.fields) { |
| | | cell.modal.fields.forEach(form => { |
| | | // 数据源sql语句,预处理,权限黑名单字段设置为隐藏表单 |
| | | if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(form.type) && form.resourceType === '1') { |
| | | sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'form', LText: `${cell.logLabel}-${form.label}(表单)`}) |
| | | } else if (form.type === 'popSelect') { |
| | | sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'popSource', LText: `${cell.logLabel}-${form.label}(表单)`}) |
| | | } |
| | | }) |
| | | } |
| | | } else if ((cell.funcType === 'refund' || cell.funcType === 'pay') && cell.payMode === 'system') { |
| | | sqls.push({uuid: cell.uuid, type: 'pay', LText: cell.logLabel}) |
| | | } |
| | | } else if (cell.OpenType === 'innerpage' || cell.OpenType === 'outerpage') { |
| | | if (cell.pageTemplate === 'pay' && cell.payMode === 'system') { |
| | | sqls.push({uuid: cell.uuid, type: 'pay', LText: cell.logLabel}) |
| | | } |
| | | } else if (cell.OpenType === 'popview') { |
| | | if (cell.config && cell.config.components && cell.config.enabled) { |
| | | let label = (item.name ? '-' + item.name : '') + '-' + cell.label |
| | | |
| | | filterComponent(cell.config.components, label, true) |
| | | } |
| | | } |
| | | |
| | | if (appType === 'admin') { |
| | | if (cell.refreshTab && cell.refreshTab.length) { |
| | | let tabId = cell.refreshTab[cell.refreshTab.length - 1] |
| | | if (!this.allMenus.includes(tabId)) { |
| | | links.push(cell.logLabel) |
| | | } |
| | | } |
| | | if (cell.openmenu && cell.openmenu.length) { |
| | | if (!Array.isArray(cell.openmenu)) { |
| | | links.push(cell.logLabel) |
| | | } else { |
| | | let menuId = cell.openmenu.slice(-1)[0] |
| | | if (!this.allMenus.includes(menuId)) { |
| | | links.push(cell.logLabel) |
| | | } |
| | | } |
| | | } |
| | | if (cell.linkmenu && cell.linkmenu.length) { |
| | | if (!Array.isArray(cell.linkmenu)) { |
| | | links.push(cell.logLabel) |
| | | } else { |
| | | let menuId = cell.linkmenu.slice(-1)[0] |
| | | if (!this.allMenus.includes(menuId)) { |
| | | links.push(cell.logLabel) |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | if (cell.openmenu && cell.openmenu.length && cell.openmenu !== 'goback' && (typeof(cell.openmenu) !== 'string' || !this.allMenus.includes(cell.openmenu))) { |
| | | links.push(cell.logLabel) |
| | | } |
| | | if (cell.linkmenu && cell.linkmenu.length && cell.linkmenu !== 'goback' && (typeof(cell.linkmenu) !== 'string' || !this.allMenus.includes(cell.linkmenu))) { |
| | | links.push(cell.logLabel) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (appType === 'mob') { |
| | | config.components.forEach(item => { |
| | | if (item.type === 'topbar' && item.wrap.type !== 'navbar' && item.search) { |
| | | let search = [] |
| | | search.push(...item.search.fields) |
| | | |
| | | item.search.groups.forEach(group => { |
| | | search.push(...group.fields) |
| | | }) |
| | | |
| | | if (search.length > 0) { |
| | | search.forEach(cell => { |
| | | if (['select', 'link', 'multiselect', 'checkcard', 'radio'].includes(cell.type) && cell.resourceType === '1' && cell.dataSource) { |
| | | sqls.push({uuid: cell.uuid, type: 'sForm', LText: `搜索栏-${cell.label}(表单)`}) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (config.interfaces && config.interfaces.length > 0) { |
| | | config.interfaces.forEach(m => { |
| | | if (m.status !== 'true' || m.setting.interType !== 'system') return false |
| | | |
| | | m.setting.$name = (config.MenuName || '') + '-' + (m.name || '') |
| | | |
| | | sqls.push({uuid: m.uuid, type: 'interface', LText: m.setting.$name}) |
| | | }) |
| | | } |
| | | |
| | | filterComponent(config.components) |
| | | } |
| | | |
| | | record = (type) => { |
| | | const { lackmenus, outmenus, unablemenus, backmenus, appbackmenus } = this.state |
| | | const { lackmenus, lacklinks, outmenus, unablemenus, backmenus, appbackmenus, btnmenus, appbtnmenus } = this.state |
| | | |
| | | let menus = [] |
| | | |
| | | lackmenus.forEach(item => { |
| | | menus.push(item.MenuID) |
| | | }) |
| | | lacklinks.forEach(item => { |
| | | menus.push(item.MenuID) |
| | | }) |
| | | outmenus.forEach(item => { |
| | |
| | | menus.push(item.MenuID) |
| | | }) |
| | | appbackmenus.forEach(item => { |
| | | menus.push(item[0].MenuID) |
| | | menus.push(item[1].MenuID) |
| | | }) |
| | | btnmenus.forEach(item => { |
| | | menus.push(item.MenuID) |
| | | }) |
| | | appbtnmenus.forEach(item => { |
| | | menus.push(item[0].MenuID) |
| | | menus.push(item[1].MenuID) |
| | | }) |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { loading, activeMenu, menulist, remain, lackmenus, outmenus, unablemenus, backmenus, appbackmenus } = this.state |
| | | const { loading, activeMenu, menulist, remain, lackmenus, lacklinks, outmenus, unablemenus, backmenus, appbackmenus, btnmenus, appbtnmenus } = this.state |
| | | |
| | | if (!sessionStorage.getItem('UserID')) return null |
| | | |
| | |
| | | return <div key={i}>{item.MenuName} <span></span> {item.pName}</div> |
| | | })} |
| | | </div> : null} |
| | | {lacklinks.length ? <div className="item-wrap"> |
| | | <div className="title">关联菜单不存在</div> |
| | | {lacklinks.map((item, i) => { |
| | | return <div key={i}>{item.MenuName} <span></span> {item.pName}</div> |
| | | })} |
| | | </div> : null} |
| | | {backmenus.length ? <div className="item-wrap"> |
| | | <div className="title">菜单后端脚本ID重复</div> |
| | | {backmenus.map((item, i) => { |
| | |
| | | return <div key={i}>{item[0].MenuName} <span></span> {item[0].pName} <SwapOutlined /> {item[1].MenuName} <span></span> {item[1].pName}</div> |
| | | })} |
| | | </div> : null} |
| | | {btnmenus.length ? <div className="item-wrap"> |
| | | <div className="title">菜单按钮ID重复</div> |
| | | {btnmenus.map((item, i) => { |
| | | return <div key={i}>{item.MenuName} <span></span> {item.pName}</div> |
| | | })} |
| | | </div> : null} |
| | | {appbtnmenus.length ? <div className="item-wrap"> |
| | | <div className="title">菜单按钮ID重复(菜单间)</div> |
| | | {appbtnmenus.map((item, i) => { |
| | | return <div key={i}>{item[0].MenuName} <span></span> {item[0].pName} <SwapOutlined /> {item[1].MenuName} <span></span> {item[1].pName}</div> |
| | | })} |
| | | </div> : null} |
| | | </div> |
| | | </div> |
| | | ) |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import moment from 'moment' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { notification, Modal, Collapse, Card, Switch, Button, Typography } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons' |
| | | import { notification, Modal, Collapse, Card, Switch, Button, Typography, message } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, CopyOutlined } from '@ant-design/icons' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | |
| | | return is(fromJS(oriConfig), fromJS(config)) |
| | | } |
| | | |
| | | copyMenu = () => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.enabled) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单未启用,不可复制。', |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | | let msg = { copyType: 'components', type: 'admin', interfaces: [] } |
| | | |
| | | msg.components = fromJS(config.components).toJS() |
| | | msg.components.forEach((item, i) => { |
| | | if (item.type === 'tabs') { |
| | | item.name = '标签组' + i |
| | | item.width = 24 |
| | | item.subtype = 'tabs' |
| | | item.setting = {autoSwitch: 'false', blacklist: [], name: item.name, position: 'top', supModule: [], tabStyle: 'line', width: 24} |
| | | |
| | | item.subtabs.forEach(tab => { |
| | | tab.components[0].subtype = 'normaltable' |
| | | tab.components[0].width = 24 |
| | | tab.components[0].wrap.width = 24 |
| | | tab.components[0].wrap.name = tab.components[0].name |
| | | |
| | | tab.components[0].action.forEach(btn => { |
| | | if (btn.OpenType === 'popview' && btn.config) { |
| | | btn.config.Template = 'CustomPage' |
| | | if (btn.config.components[0]) { |
| | | btn.config.components[0].subtype = 'normaltable' |
| | | } |
| | | } |
| | | }) |
| | | tab.components[0].cols = tab.components[0].cols.filter(col => !(col.field && col.Hide === 'true')) |
| | | tab.components[0].cols.forEach(col => { |
| | | if (col.type !== 'custom') return |
| | | col.elements.forEach(btn => { |
| | | if (btn.OpenType === 'popview' && btn.config) { |
| | | btn.config.Template = 'CustomPage' |
| | | if (btn.config.components[0]) { |
| | | btn.config.components[0].subtype = 'normaltable' |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | }) |
| | | } else { |
| | | item.subtype = 'normaltable' |
| | | item.width = 24 |
| | | item.wrap.width = 24 |
| | | item.wrap.name = item.name |
| | | item.action.forEach(btn => { |
| | | if (btn.OpenType === 'popview' && btn.config) { |
| | | btn.config.Template = 'CustomPage' |
| | | if (btn.config.components[0]) { |
| | | btn.config.components[0].subtype = 'normaltable' |
| | | } |
| | | } |
| | | }) |
| | | item.cols = item.cols.filter(col => !(col.field && col.Hide === 'true')) |
| | | item.cols.forEach(col => { |
| | | if (col.type !== 'custom') return |
| | | col.elements.forEach(btn => { |
| | | if (btn.OpenType === 'popview' && btn.config) { |
| | | btn.config.Template = 'CustomPage' |
| | | if (btn.config.components[0]) { |
| | | btn.config.components[0].subtype = 'normaltable' |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | if (msg.components[0].search && msg.components[0].search.length > 0) { |
| | | let cell = { |
| | | uuid: Utils.getuuid(), |
| | | type: 'search', |
| | | width: 24, |
| | | subtype: 'mainsearch', |
| | | name: '搜索', |
| | | search: msg.components[0].search, |
| | | style: {borderBottomColor: '#f0f0f0', borderBottomWidth: '1px'}, |
| | | wrap: {float: 'left', blacklist: [], name: '搜索', width: 24} |
| | | } |
| | | |
| | | cell.wrap.advanceType = msg.components[0].wrap.advanceType || 'modal' |
| | | cell.wrap.advanceWidth = msg.components[0].wrap.advanceWidth || 1000 |
| | | cell.wrap.searchLwidth = msg.components[0].wrap.searchLwidth || 33.3 |
| | | cell.wrap.searchRatio = msg.components[0].wrap.searchRatio || 6 |
| | | cell.wrap.resetContrl = msg.components[0].wrap.resetContrl || 'init' |
| | | cell.wrap.show = msg.components[0].wrap.show || 'true' |
| | | |
| | | if (cell.wrap.advanceType === 'drawer') { |
| | | cell.wrap.drawerPlacement = msg.components[0].wrap.drawerPlacement || 'left' |
| | | } |
| | | |
| | | msg.components[0].search = [] |
| | | msg.components[0].setting.useMSearch = 'true' |
| | | |
| | | msg.components.unshift(cell) |
| | | msg.components[0].$tables = getTables(msg.components[0]) |
| | | msg.components[1].$tables = getTables(msg.components[1]) |
| | | } |
| | | |
| | | try { |
| | | msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) |
| | | } catch (e) { |
| | | console.warn('Stringify Failure') |
| | | msg = '' |
| | | } |
| | | |
| | | let oInput = document.createElement('input') |
| | | oInput.value = msg |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | document.body.removeChild(oInput) |
| | | message.success('复制成功。') |
| | | } |
| | | } |
| | | |
| | | updateLogConfig = (config) => { |
| | | config.fstMenuId = this.state.config.fstMenuId || config.fstMenuId || '' |
| | | config.parentId = this.state.config.parentId || config.parentId || '' |
| | |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '0px 0px 0px 5px'}}>菜单组件 <CopyOutlined onClick={this.copyMenu} style={{marginLeft: '3px', cursor: 'pointer', color: '#1890ff'}} /></Paragraph> |
| | | </> : null} |
| | | </Panel> |
| | | <Panel header="搜索" key="search"> |
| | |
| | | <div className={'menu-view' + (menuloading ? ' saving' : '')}> |
| | | <Card bordered={false} extra={ |
| | | <div className="mk-opeartion-list"> |
| | | {/* <Dropdown overlay={ |
| | | <div className="mk-button-dropdown-wrap"> |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | </div> |
| | | } trigger={['click']} placement="bottomCenter"> |
| | | <Button className="mk-button-more">更多<DownOutlined/></Button> |
| | | </Dropdown> */} |
| | | {config ? <Debug config={config}/> : null} |
| | | {config ? <Transfer config={config}/> : null} |
| | | {config ? <Unattended config={config} updateConfig={this.updateConfig}/> : null} |