| | |
| | | render() { |
| | | const { type, ...resProps } = this.props |
| | | |
| | | if (!type || !MkIcons[type]) return null |
| | | |
| | | return ( |
| | | MkIcons[type](resProps) |
| | | ) |
| | | if (!type) { |
| | | return null |
| | | } else if (MkIcons[type]) { |
| | | return ( |
| | | MkIcons[type](resProps) |
| | | ) |
| | | } else { |
| | | return <span className={'anticon ' + (resProps.className || '')} style={resProps.style || null} dangerouslySetInnerHTML={{ __html: type }}></span> |
| | | } |
| | | } |
| | | } |
| | | export default MkIcon |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Modal, Row, Col, Button } from 'antd' |
| | | import { CloseCircleFilled } from '@ant-design/icons' |
| | | import { Modal, Row, Col, Button, Tabs, notification } from 'antd' |
| | | import { CloseCircleFilled, RedoOutlined } from '@ant-design/icons' |
| | | |
| | | import Api from '@/api' |
| | | import { minkeIconSystem } from '@/utils/option.js' |
| | | import MkIcon from '@/components/mk-icon' |
| | | import './index.scss' |
| | | |
| | | const { TabPane } = Tabs |
| | | // ['direction', 'edit', 'normal', 'data', 'hint'] |
| | | |
| | | class MkEditIcon extends Component { |
| | |
| | | selectIcon: '', |
| | | allowClear: false, |
| | | icons: [], |
| | | cusicons: [], |
| | | visible: false |
| | | } |
| | | |
| | |
| | | this.setState({selectIcon: val, allowClear: this.props.allowClear === true, icons}) |
| | | } |
| | | |
| | | componentDidMount() { |
| | | if (!window.GLOB.designView) { |
| | | if (sessionStorage.getItem('systemIcons')) { |
| | | this.setState({cusicons: JSON.parse(sessionStorage.getItem('systemIcons'))}) |
| | | } else { |
| | | this.getIcons() |
| | | } |
| | | } |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | |
| | | this.props.onChange(val) |
| | | } |
| | | |
| | | getIcons = () => { |
| | | Api.getSystemConfig({ func: 's_get_icons' }).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | sessionStorage.setItem('systemIcons', JSON.stringify([])) |
| | | return |
| | | } else if (!res.data) { |
| | | return |
| | | } |
| | | |
| | | let icons = res.data.map(item => { |
| | | item.icon_svg = window.decodeURIComponent(window.atob(item.icon_svg)) |
| | | return item |
| | | }) |
| | | |
| | | sessionStorage.setItem('systemIcons', JSON.stringify(icons)) |
| | | |
| | | this.setState({cusicons: icons}) |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { selectIcon, visible, icons, allowClear } = this.state |
| | | const { selectIcon, visible, icons, allowClear, cusicons } = this.state |
| | | |
| | | return ( |
| | | <div className="mk-icon-box"> |
| | |
| | | <MkIcon className="trigger" onClick={() => this.setState({visible: true})} type="swap"/> |
| | | {allowClear && selectIcon ? <CloseCircleFilled className="close" onClick={() => this.checkIcon('')}/> : null} |
| | | <Modal |
| | | wrapClassName="popview-modal mk-icon-wrap" |
| | | title={'图标选择'} |
| | | wrapClassName="mk-pop-modal mk-icon-wrap" |
| | | // title={'图标选择'} |
| | | visible={visible} |
| | | width={800} |
| | | maskClosable={false} |
| | |
| | | ]} |
| | | destroyOnClose |
| | | > |
| | | <Row> |
| | | {icons.map(icon => <Col className={icon === selectIcon ? 'active' : ''} key={icon} span={4}> |
| | | <MkIcon onClick={() => this.checkIcon(icon)} type={icon} /> |
| | | </Col>)} |
| | | </Row> |
| | | <Tabs className={cusicons.length > 0 ? 'dubble-tabs' : ''}> |
| | | <TabPane tab="系统" key="setting"> |
| | | <Row> |
| | | {icons.map(icon => <Col className={icon === selectIcon ? 'active' : ''} key={icon} span={4}> |
| | | <MkIcon onClick={() => this.checkIcon(icon)} type={icon} /> |
| | | </Col>)} |
| | | </Row> |
| | | </TabPane> |
| | | <TabPane tab={ |
| | | <span className="tab-control"> |
| | | <RedoOutlined onClick={(e) => {this.getIcons()}}/> |
| | | 自定义 |
| | | </span> |
| | | } key="scripts"> |
| | | <Row> |
| | | {cusicons.map(icon => <Col key={icon.id} span={4} onClick={() => this.checkIcon(icon.icon_svg)}> |
| | | <MkIcon type={icon.icon_svg} /> |
| | | </Col>)} |
| | | </Row> |
| | | </TabPane> |
| | | </Tabs> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | |
| | | clear: both; |
| | | } |
| | | .mk-icon-wrap { |
| | | .ant-modal { |
| | | top: 50px!important; |
| | | } |
| | | .ant-col { |
| | | text-align: center; |
| | | line-height: 55px; |
| | |
| | | color: #1890ff; |
| | | } |
| | | } |
| | | .tab-control { |
| | | position: relative; |
| | | .anticon-redo { |
| | | display: none; |
| | | position: absolute; |
| | | left: -20px; |
| | | top: 0px; |
| | | } |
| | | } |
| | | .ant-tabs-tab-active.ant-tabs-tab { |
| | | .tab-control { |
| | | .anticon-redo { |
| | | display: inline-block; |
| | | } |
| | | } |
| | | } |
| | | .ant-tabs-nav .ant-tabs-tab { |
| | | padding: 12px 20px; |
| | | } |
| | | .ant-tabs-top.dubble-tabs { |
| | | .ant-tabs-bar { |
| | | padding-top: 10px!important; |
| | | } |
| | | } |
| | | .ant-tabs-top:not(.dubble-tabs) { |
| | | .ant-tabs-top-bar { |
| | | border-bottom: 0px; |
| | | .ant-tabs-nav-container { |
| | | display: none; |
| | | } |
| | | } |
| | | .ant-tabs-content { |
| | | max-height: calc(100vh - 180px)!important; |
| | | } |
| | | } |
| | | } |
| | |
| | | group.subButton.style = style |
| | | } else if (card.type === 'next') { |
| | | group.nextButton.style = style |
| | | } else if (card.type === 'close') { |
| | | group.closeButton.style = style |
| | | } |
| | | |
| | | this.props.updateconfig(group) |
| | |
| | | newcard.focus = true |
| | | newcard.label = 'button' |
| | | newcard.verify = null |
| | | newcard.show = 'link' |
| | | newcard.show = 'button' |
| | | newcard.Ot = 'requiredSgl' |
| | | newcard.OpenType = item.value |
| | | newcard.class = 'primary' |
| | |
| | | return |
| | | } |
| | | |
| | | if (change && columns.length === 0) { |
| | | reject() |
| | | return |
| | | } |
| | | |
| | | if ((setting.interType === 'system' && setting.execute !== 'false') || _scripts.length > 0) { |
| | | let timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | let r = SettingUtils.getDebugSql(setting, _scripts, columns, searches, defaultSearch, timestamp) |
| | |
| | | }) |
| | | } |
| | | |
| | | if (!arr_field) { |
| | | arr_field = '*' |
| | | } |
| | | |
| | | if (setting.interType === 'system' && setting.execute !== 'false') { |
| | | _dataresource = setting.dataresource || '' |
| | | } |
| | |
| | | |
| | | let sumSql = '' |
| | | |
| | | if (arr_field && _dataresource && /\/\*\$sum@/ig.test(_dataresource)) { |
| | | if (_dataresource && /\/\*\$sum@/ig.test(_dataresource)) { |
| | | let _sql = _dataresource.replace(/\/\*\$sum@|@sum\$\*\//ig, '') |
| | | _sql = `/*system_query*/${_sql} ${_search}` |
| | | if (_customScript) { |
| | |
| | | } |
| | | |
| | | // 数据源处理, 存在显示列时 |
| | | if (arr_field && _dataresource) { |
| | | if (_dataresource) { |
| | | if (/\s/.test(_dataresource)) { |
| | | _dataresource = '(' + _dataresource + ') tb' |
| | | } |
| | |
| | | sumSql = sumSql.replace(/\n/g, ' ') |
| | | } |
| | | sql = sql.replace(/\n/g, ' ') |
| | | |
| | | |
| | | return { error, sql, sumSql, errors: errors.join(';') } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | .grid-layout { |
| | | >.ant-col { |
| | | display: inline-block; |
| | | float: none; |
| | | vertical-align: top; |
| | | } |
| | | } |
| | | } |
| | | .menu-menubar-edit-box::after { |
| | | display: block; |
| | |
| | | } |
| | | |
| | | // 权限过滤 |
| | | if (!window.GLOB.mkHS) { |
| | | if (config.tab && !window.GLOB.mkActions[config.tab.linkTab]) { |
| | | config.tab = null |
| | | } |
| | | } |
| | | if (config.tab) { |
| | | config.tab.uuid = Utils.getuuid() |
| | | } |
| | |
| | | render() { |
| | | const { config, loading, BID, BData, data, group, dict } = this.state |
| | | |
| | | if (config.setting.supModule && !BID) return null |
| | | |
| | | return ( |
| | | <div className="custom-simple-form-box" id={'anchor' + config.uuid} style={{...config.style}}> |
| | | {loading ? |
| | |
| | | dict={dict} |
| | | data={data} |
| | | action={group} |
| | | unload={config.setting.supModule && !BID} |
| | | inputSubmit={() => this.mkFormSubmit(group.uuid)} |
| | | wrappedComponentRef={(inst) => this.formRef = inst} |
| | | /> : null} |
| | |
| | | render() { |
| | | const { config, loading, BID, BData, data, group, dict, step } = this.state |
| | | |
| | | if (config.setting.supModule && !BID) return null |
| | | |
| | | return ( |
| | | <div className="custom-normal-form-box" id={'anchor' + config.uuid} style={{...config.style}}> |
| | | {loading ? |
| | |
| | | dict={dict} |
| | | data={data} |
| | | action={group} |
| | | unload={config.setting.supModule && !BID} |
| | | inputSubmit={() => this.mkFormSubmit(group.uuid)} |
| | | wrappedComponentRef={(inst) => this.formRef = inst} |
| | | /> : null} |
| | |
| | | render() { |
| | | const { config, loading, BID, BData, data, group, dict } = this.state |
| | | |
| | | if (config.setting.supModule && !BID) return null |
| | | |
| | | return ( |
| | | <div className="custom-tab-form-box" id={'anchor' + config.uuid} style={{...config.style}}> |
| | | {loading ? |
| | |
| | | dict={dict} |
| | | data={data} |
| | | action={group} |
| | | unload={config.setting.supModule && !BID} |
| | | inputSubmit={() => this.mkFormSubmit(group.uuid)} |
| | | wrappedComponentRef={(inst) => this.formRef = inst} |
| | | /> : null} |
| | |
| | | BData={BData} |
| | | columns={config.columns} |
| | | selectedData={selectedData} |
| | | /> : <div style={{height: '25px'}}></div>} |
| | | /> : <div className="mk-action-space" style={{height: '25px'}}></div>} |
| | | <div className="main-table-box"> |
| | | <MainTable |
| | | setting={setting} |
| | |
| | | BData={BData} |
| | | columns={config.columns} |
| | | selectedData={selectedData} |
| | | /> : <div style={{height: '15px'}}></div>} |
| | | /> : <div className="mk-action-space" style={{height: '25px'}}></div>} |
| | | <div className={'main-table-box ' + (!actions || actions.length === 0 ? 'no-action' : '')}> |
| | | <MainTable |
| | | setting={setting} |
| | |
| | | config.tabgroups = _tabgroups |
| | | } |
| | | |
| | | if (!window.GLOB.mkHS) { |
| | | config.action = config.action.filter(item => window.GLOB.mkActions[item.uuid]) |
| | | config.tabgroups.forEach(group => { |
| | | group.sublist = group.sublist.filter(tab => { |
| | | if (tab.supMenu === 'mainTable') { |
| | | tab.supMenu = MenuID |
| | | } |
| | | tab.ContainerId = this.state.ContainerId |
| | | return window.GLOB.mkActions[tab.linkTab] |
| | | }) |
| | | config.tabgroups.forEach(group => { |
| | | group.sublist = group.sublist.map(tab => { |
| | | if (tab.supMenu === 'mainTable') { |
| | | tab.supMenu = MenuID |
| | | } |
| | | tab.ContainerId = this.state.ContainerId |
| | | return tab |
| | | }) |
| | | } else { |
| | | config.tabgroups.forEach(group => { |
| | | group.sublist = group.sublist.filter(tab => { |
| | | if (tab.supMenu === 'mainTable') { |
| | | tab.supMenu = MenuID |
| | | } |
| | | tab.ContainerId = this.state.ContainerId |
| | | return true |
| | | }) |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | // 按钮类型兼容 |
| | | config.action = config.action.map(item => { |
| | |
| | | config = updateSubTable(config) |
| | | |
| | | // 权限过滤 |
| | | if (!window.GLOB.mkHS) { |
| | | config.action = config.action.filter(item => item.hidden !== 'true' && window.GLOB.mkActions[item.uuid]) |
| | | } else { |
| | | config.action = config.action.filter(item => item.hidden !== 'true') |
| | | } |
| | | config.action = config.action.filter(item => item.hidden !== 'true') |
| | | |
| | | config.search = Utils.initSearchVal(config.search) |
| | | |
| | |
| | | } |
| | | |
| | | // 权限过滤 |
| | | if (!window.GLOB.mkHS) { |
| | | config.action = config.action.filter(item => item.hidden !== 'true' && window.GLOB.mkActions[item.uuid]) |
| | | } else { |
| | | config.action = config.action.filter(item => item.hidden !== 'true') |
| | | } |
| | | config.action = config.action.filter(item => item.hidden !== 'true') |
| | | |
| | | config.search = Utils.initSearchVal(config.search) |
| | | |
| | |
| | | |
| | | // 权限过滤 |
| | | config.tabgroups.forEach(group => { |
| | | group.sublist = group.sublist.filter(tab => { |
| | | group.sublist = group.sublist.map(tab => { |
| | | if (tab.supMenu === 'mainTable' || (!tab.supMenu && tab.level === 0)) { |
| | | tab.isTreeNode = true |
| | | } |
| | |
| | | } |
| | | tab.ContainerId = this.state.ContainerId |
| | | |
| | | return window.GLOB.mkActions[tab.linkTab]} |
| | | ) |
| | | return tab |
| | | }) |
| | | }) |
| | | |
| | | let _tabgroups = [] |
| | |
| | | data: PropTypes.any, // 表格数据 |
| | | BID: PropTypes.any, // 主表ID |
| | | BData: PropTypes.any, // 主表数据 |
| | | unload: PropTypes.any, // 下拉菜单不加载数据 |
| | | inputSubmit: PropTypes.func // input回车提交 |
| | | } |
| | | |
| | |
| | | record = {} |
| | | |
| | | componentDidMount () { |
| | | const { action } = this.props |
| | | const { action, unload } = this.props |
| | | |
| | | let data = {} |
| | | let BData = {} |
| | |
| | | this.record = record |
| | | |
| | | this.setState({ formlist }, () => { |
| | | if (unload) return |
| | | |
| | | if (action.setting && action.setting.focus && fieldMap.has(action.setting.focus)) { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkFC', 'focus', fieldMap.get(action.setting.focus).uuid) |
| | |
| | | </Col> |
| | | <Col span={24} className="sql"> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" overlayStyle={{width: '320px', maxWidth: '320px'}} title={<><div>{'调试替换符 /*$breakpoint_begin_xxxx@ 、@breakpoint_end_xxxx$*/,在控制台中输入 window.debug = \'xxxx\' 会启用对应的调试语句,快捷键 ctrl+c 或在控制台中输入 window.debug = false 关闭调试。注:调试时字符 $breakpoint_proc@ 将被替换。'}</div><div style={{height: '5px'}}></div><div>{'数据检查替换符 $check@ -> \'\'、 @check$ -> \'\',ErrorCode等于C时 $check@ -> /*、 @check$ -> */。注:1、需使用系统接口 2、行设置为“选择多行”时无效。'}</div></>}> |
| | | <Tooltip placement="topLeft" overlayStyle={{width: '320px', maxWidth: '320px'}} title={<><div>{'调试替换符 /*$breakpoint_begin_xxxx@ 、@breakpoint_end_xxxx$*/,在控制台中输入 window.debug = \'xxxx\' 会启用对应的调试语句,快捷键 ctrl+c 或在控制台中输入 window.debug = false 关闭调试。注:调试时字符 $breakpoint_proc@ 将被替换。'}</div><div style={{height: '5px'}}></div><div>{'数据检查替换符 $check@ -> \'\'、 @check$ -> \'\',ErrorCode等于C时会询问是否继续执行,确定时 $check@ -> /*、 @check$ -> */。注:1、需使用系统接口 2、行设置为“选择多行”时无效。'}</div></>}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | sql |
| | | </Tooltip> |
| | |
| | | }) |
| | | } |
| | | component.cols = getColumns(component.cols) |
| | | component.statFields = [] |
| | | } |
| | | |
| | | if (component.wrap && component.wrap.datatype === 'static') { |
| | |
| | | .g2-tooltip { |
| | | display: none; |
| | | } |
| | | .mk-action-space { |
| | | display: none; |
| | | } |
| | | } |
| | | |
| | | .print-page { |
| | |
| | | } |
| | | |
| | | handleButton = (type) => { |
| | | const that = this |
| | | // 菜单编辑:添加,确定,取消 |
| | | let _menuchange = !is(fromJS(this.state.menulist), fromJS(this.props.menulist)) |
| | | |
| | | if (type === 'confirm' && _menuchange) { |
| | | let _this = this |
| | | let param = { |
| | | func: 'sPC_Menu_SortUpt', |
| | | LText: this.state.menulist.map((item, index) => { |
| | |
| | | onOk() { |
| | | return Api.getSystemConfig(param).then(res => { |
| | | if (res.status) { |
| | | _this.props.reload() |
| | | that.props.reload() |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | onCancel() {} |
| | | }) |
| | | } else if (type === 'cancel' && _menuchange) { |
| | | let _this = this |
| | | |
| | | confirm({ |
| | | title: '菜单顺序已调整,放弃保存吗?', |
| | | content: '', |
| | | onOk() { |
| | | _this.props.exitEdit() |
| | | that.props.exitEdit() |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | import { setGLOBFuncs } from '@/utils/utils.js' |
| | | import Sidemenu from './sidemenu' |
| | | |
| | | import '@/assets/css/design.scss' |
| | | import './index.scss' |
| | | |
| | | const _locale = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | |
| | | componentDidMount() { |
| | | window.debugger = false |
| | | window.GLOB.breakpoint = false |
| | | window.GLOB.designView = true |
| | | sessionStorage.removeItem('breakpoint') |
| | | setGLOBFuncs() |
| | | } |
| | |
| | | } |
| | | |
| | | handleSubBtn = (type) => { |
| | | const that = this |
| | | if (type === 'confirm') { // 保存调整后的顺序 |
| | | let param = { |
| | | func: 'sPC_Menu_SortUpt', |
| | |
| | | }) |
| | | } else if (type === 'close') { // 退出编辑 |
| | | if (this.state.change) { |
| | | let _this = this |
| | | |
| | | confirm({ |
| | | title: '菜单顺序已调整,放弃保存吗?', |
| | | content: '', |
| | | onOk() { |
| | | _this.props.exitEdit() |
| | | that.props.exitEdit() |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | } |
| | | |
| | | handleSubBtn = (type) => { |
| | | const that = this |
| | | // 操作按钮:添加、解除冻结、确认及关闭 |
| | | if (type === 'confirm') { |
| | | let param = { |
| | |
| | | }) |
| | | } else if (type === 'close') { |
| | | if (this.state.change) { |
| | | let _this = this |
| | | |
| | | confirm({ |
| | | title: '菜单顺序已调整,放弃保存吗?', |
| | | content: '', |
| | | onOk() { |
| | | _this.props.exitEdit() |
| | | }, |
| | | onCancel() {} |
| | | that.props.exitEdit() |
| | | } |
| | | }) |
| | | } else { |
| | | this.props.exitEdit() |