| | |
| | | } else if (e.key === 'getSysPermission' && e.newValue === window.GLOB.appkey) { |
| | | localStorage.setItem('sysPermissions', JSON.stringify({mkThdMenus: window.GLOB.mkThdMenus, mkActions: window.GLOB.mkActions})) |
| | | } else if (e.key === 'menuUpdate') { |
| | | let menuId = e.newValue.split(',')[1] |
| | | if (menuId) { |
| | | let vals = e.newValue.split(',') |
| | | let menuId = vals[1] |
| | | let position = vals[2] || '' |
| | | if (position === 'menu') { |
| | | MKEmitter.emit('reloadMenuView', menuId) |
| | | } else if (menuId) { |
| | | Api.getAppVersion(menuId).then(() => { |
| | | MKEmitter.emit('reloadMenuView', menuId) |
| | | }) |
| | |
| | | GLOB.mkThdMenus = [] // 三级菜单 |
| | | GLOB.mkActions = {} // 按钮权限集 |
| | | |
| | | if (sessionStorage.getItem('breakpoint')) { |
| | | window.debugger = true |
| | | GLOB.breakpoint = sessionStorage.getItem('breakpoint') |
| | | } else { |
| | | GLOB.breakpoint = false |
| | | } |
| | | |
| | | Object.defineProperty(GLOB, 'appId', { |
| | | writable: false, |
| | | value: GLOB.appId |
| | |
| | | Object.defineProperty(GLOB, 'systemType', { |
| | | writable: false, |
| | | value: GLOB.systemType |
| | | }) |
| | | Object.defineProperty(GLOB, 'debugger', { |
| | | writable: false, |
| | | value: GLOB.debugger |
| | | }) |
| | | Object.defineProperty(GLOB, 'mainSystemApi', { |
| | | writable: false, |
| | |
| | | writable: false, |
| | | value: GLOB.cloudServiceApi || '' |
| | | }) |
| | | |
| | | if (GLOB.sysType === 'cloud') { |
| | | Object.defineProperty(GLOB, 'debugger', { |
| | | writable: false, |
| | | value: GLOB.debugger |
| | | }) |
| | | |
| | | GLOB.breakpoint = false |
| | | } else { |
| | | if (sessionStorage.getItem('breakpoint')) { |
| | | GLOB.debugger = true |
| | | GLOB.breakpoint = sessionStorage.getItem('breakpoint') |
| | | } else { |
| | | GLOB.breakpoint = false |
| | | } |
| | | } |
| | | |
| | | Object.defineProperty(window, 'GLOB', { |
| | | writable: false, |
| | | value: GLOB |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, Checkbox, Typography } from 'antd' |
| | | import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, Checkbox } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import { formRule } from '@/utils/option.js' |
| | | |
| | |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | const { Paragraph } = Typography |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | const MKTable = asyncComponent(() => import('@/components/normalform/modalform/mkTable')) |
| | | const acTyOptions = { |
| | |
| | | fields.push( |
| | | <Col span={span} key={index}> |
| | | <Form.Item className={className} help={item.help} label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <Tooltip placement="topLeft" overlayStyle={{maxWidth: item.tooltip.length > 25 ? 350 : 250 }} title={<span onClick={(e) => e.stopPropagation()}>{item.tooltip}</span>}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | |
| | | </Col> |
| | | ) |
| | | }) |
| | | |
| | | if (window.debugger && this.props.card.uuid) { |
| | | fields.push( |
| | | <Col span={12} key="uuid"> |
| | | <Form.Item label="按钮ID"> |
| | | <Paragraph copyable>{this.props.card.uuid}</Paragraph> |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | |
| | | return fields |
| | | } |
| | |
| | | key: 'label', |
| | | label: '按钮名称', |
| | | initVal: card.label, |
| | | tooltip: card.uuid ? '按钮ID:' + card.uuid : '', |
| | | required: true, |
| | | }, |
| | | { |
| | |
| | | key: 'label', |
| | | label: '按钮名称', |
| | | initVal: card.label, |
| | | tooltip: card.uuid ? '按钮ID:' + card.uuid : '', |
| | | required: true, |
| | | }, |
| | | { |
| | |
| | | {path: '/role/:param', name: 'role', component: RoleManage}, |
| | | {path: '/hs', name: 'hs', component: SystemFunc}, |
| | | {path: '/proc', name: 'proc', component: SystemProc}, |
| | | {path: '/proc/:func', name: 'proc', component: SystemProc}, |
| | | {path: '/iframe/:menuId/:loginUid', name: 'iframe', component: MkIframe}, |
| | | {path: '/iframe/:menuId/:loginUid/:bid', name: 'iframe', component: MkIframe}, |
| | | {path: '/view/:menuId', name: 'iframe', component: MkIframe}, |
| | |
| | | let _shortcut = `${preKey}+${keyCode}` |
| | | |
| | | if (window.GLOB.breakpoint && _shortcut === 'ctrl+67') { |
| | | window.debugger = false |
| | | window.GLOB.breakpoint = false |
| | | sessionStorage.removeItem('breakpoint') |
| | | |
| | |
| | | let _shortcut = `${preKey}+${keyCode}` |
| | | |
| | | if (window.GLOB.breakpoint && _shortcut === 'ctrl+67') { |
| | | window.debugger = false |
| | | window.GLOB.breakpoint = false |
| | | sessionStorage.removeItem('breakpoint') |
| | | |
| | |
| | | let func = new Function('data', card.formula) |
| | | val = func(_data) |
| | | } catch (e) { |
| | | if (window.debugger) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.warn(e) |
| | | } |
| | | val = '' |
| | |
| | | // eslint-disable-next-line |
| | | _val = eval(_val) |
| | | } catch (e) { |
| | | if (window.debugger) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.info(_val) |
| | | console.warn(e) |
| | | } |
| | |
| | | // eslint-disable-next-line |
| | | _val = eval(_val) |
| | | } catch (e) { |
| | | if (window.debugger) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.info(_val) |
| | | console.warn(e) |
| | | } |
| | |
| | | let func = new Function('data', col.formula) |
| | | content = func([record]) |
| | | } catch (e) { |
| | | if (window.debugger) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.warn(e) |
| | | } |
| | | content = '' |
| | |
| | | // eslint-disable-next-line |
| | | content = eval(content) |
| | | } catch (e) { |
| | | if (window.debugger) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.info(content) |
| | | console.warn(e) |
| | | } |
| | |
| | | let func = new Function('data', col.formula) |
| | | content = func([record]) |
| | | } catch (e) { |
| | | if (window.debugger) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.warn(e) |
| | | } |
| | | content = '' |
| | |
| | | // eslint-disable-next-line |
| | | content = eval(content) |
| | | } catch (e) { |
| | | if (window.debugger) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.info(content) |
| | | console.warn(e) |
| | | } |
| | |
| | | let func = new Function('data', col.formula) |
| | | content = func([record]) |
| | | } catch (e) { |
| | | if (window.debugger) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.warn(e) |
| | | } |
| | | content = '' |
| | |
| | | // eslint-disable-next-line |
| | | content = eval(content) |
| | | } catch (e) { |
| | | if (window.debugger) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.info(content) |
| | | console.warn(e) |
| | | } |
| | |
| | | let mainItems = [] // 云端或单点数据 |
| | | let localItems = [] // 本地数据 |
| | | let cache = setting.cache !== 'false' |
| | | let debug = window.GLOB.debugger === true || window.debugger === true |
| | | let debug = window.GLOB.debugger === true |
| | | let _sql = `Declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) select @mk_departmentcode='${sessionStorage.getItem('departmentcode') || ''}',@mk_organization='${sessionStorage.getItem('organization') || ''}',@mk_user_type='${sessionStorage.getItem('mk_user_type') || ''}'\n` |
| | | let _sso = _sql |
| | | |
| | |
| | | let _shortcut = `${preKey}+${keyCode}` |
| | | |
| | | if (window.GLOB.breakpoint && _shortcut === 'ctrl+67') { |
| | | window.debugger = false |
| | | window.GLOB.breakpoint = false |
| | | sessionStorage.removeItem('breakpoint') |
| | | |
| | |
| | | param.custom_script = param.custom_script.replace(/@typename@/ig, `'admin'`) |
| | | |
| | | // 测试系统打印查询语句 |
| | | if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) { |
| | | if (window.GLOB.debugger === true) { |
| | | param.custom_script && console.info(`${LText ? '' : '/*不执行默认sql*/\n'}${param.custom_script}`) |
| | | LText && console.info(LText) |
| | | } |
| | |
| | | if (btn.Ot === 'required') { |
| | | data.forEach(item => { |
| | | let _id = item.$$uuid || '' |
| | | let url = '#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: _id, tempId: btn.printTemp, dataM: sessionStorage.getItem('dataM') }))) |
| | | let url = '#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: _id, tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') }))) |
| | | window.open(url) |
| | | }) |
| | | } else if (btn.Ot === 'requiredOnce') { |
| | | Id = data.map(item => item.$$uuid).filter(Boolean).join(',') |
| | | |
| | | window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: Id, tempId: btn.printTemp, dataM: sessionStorage.getItem('dataM') })))) |
| | | window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: Id, tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') })))) |
| | | } else { |
| | | window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: Id, tempId: btn.printTemp, dataM: sessionStorage.getItem('dataM') })))) |
| | | window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: Id, tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') })))) |
| | | } |
| | | } else if (btn.pageTemplate === 'billprintTemp') { |
| | | let src = '#/menudesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({ MenuType: 'billPrint', MenuId: Id, MenuNo: MenuNo, MenuName: name || '打印', Remark: Remark }))) |
| | |
| | | sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) |
| | | sql = sql.replace(/@typename@/ig, `'admin'`) |
| | | |
| | | if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.info(sql.replace(/\n\s{8}/ig, '\n')) |
| | | } |
| | | |
| | |
| | | Sort: index + 1 |
| | | })) |
| | | |
| | | if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) { |
| | | if (window.GLOB.debugger === true) { |
| | | let sql = [...lineMap.values()].map(item => (` |
| | | ${item.insert} |
| | | ${item.selects.join(` union all |
| | |
| | | if (!id) return |
| | | |
| | | setTimeout(() => { |
| | | window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: id, tempId: btn.verify.printTempId, dataM: sessionStorage.getItem('dataM') })))) |
| | | window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: id, tempId: btn.verify.printTempId, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') })))) |
| | | }, 500) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // 测试系统打印查询语句 |
| | | if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) { |
| | | if (window.GLOB.debugger === true) { |
| | | _customScript && console.info(`${btn.logLabel ? `/*${btn.logLabel} 自定义脚本*/\n` : ''}${LText ? '' : '/*不执行默认sql*/\n'}${_customScript}`) |
| | | LText && console.info(`${btn.logLabel ? `/*${btn.logLabel} 数据源*/\n` : ''}` + LText.replace(/\n\s{8}/ig, '\n')) |
| | | } |
| | |
| | | let mainItems = [] // 云端或单点数据 |
| | | let localItems = [] // 本地数据 |
| | | let cache = action.setting.cache !== 'false' |
| | | let debug = window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud') |
| | | let debug = window.GLOB.debugger === true |
| | | |
| | | let _sql = `Declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) select @mk_departmentcode='${sessionStorage.getItem('departmentcode') || ''}',@mk_organization='${sessionStorage.getItem('organization') || ''}',@mk_user_type='${sessionStorage.getItem('mk_user_type') || ''}'\n` |
| | | let _sso = _sql |
| | |
| | | */ |
| | | improveSimpleActionForm = (deForms) => { |
| | | let cache = this.props.action.setting.cache !== 'false' |
| | | let debug = window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud') |
| | | let _sql = `Declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) select @mk_departmentcode='${sessionStorage.getItem('departmentcode') || ''}',@mk_organization='${sessionStorage.getItem('organization') || ''}',@mk_user_type='${sessionStorage.getItem('mk_user_type') || ''}'\n` |
| | | |
| | | let deffers = deForms.map((form, index) => { |
| | |
| | | param.LText = param.LText.replace(/@ID@/ig, `'${this.state.ID || ''}'`) |
| | | param.LText = param.LText.replace(/@BID@/ig, `'${this.props.BID || ''}'`) |
| | | |
| | | if (debug) { |
| | | if (window.GLOB.debugger) { |
| | | console.info(param.LText) |
| | | } |
| | | |
| | |
| | | if (item.resourceType === '1' && item.dataSource) { |
| | | let _option = Utils.getSelectQueryOptions(item) |
| | | |
| | | if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.info(_option.sql) |
| | | } |
| | | |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, Typography } from 'antd' |
| | | import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | |
| | | import { formRule } from '@/utils/option.js' |
| | |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | |
| | | const { TextArea } = Input |
| | | const { Paragraph } = Typography |
| | | const actionTypeOptions = { |
| | | pop: ['label', 'position', 'OpenType', 'intertype', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'openmenu', 'output', 'tipTitle', 'hidden'], |
| | | prompt: ['label', 'position', 'OpenType', 'intertype', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'openmenu', 'output', 'tipTitle', 'hidden'], |
| | |
| | | ) |
| | | }) |
| | | |
| | | if (window.debugger && this.props.card.uuid) { |
| | | fields.push( |
| | | <Col span={12} key="uuid"> |
| | | <Form.Item label="按钮ID"> |
| | | <Paragraph copyable>{this.props.card.uuid}</Paragraph> |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | return fields |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // 测试系统打印查询语句 |
| | | if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) { |
| | | if (window.GLOB.debugger === true) { |
| | | _customScript && console.info(`${setting.$name ? `/*${setting.$name} 自定义脚本*/\n` : ''}${LText ? '' : '/*不执行默认sql*/\n'}${_customScript}`) |
| | | LText && console.info(`${setting.$name ? `/*${setting.$name} 数据源*/\n` : ''}` + LText.replace(/\n\s{8}/ig, '\n')) |
| | | } |
| | |
| | | } |
| | | |
| | | // 测试系统打印查询语句 |
| | | if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) { |
| | | if (window.GLOB.debugger === true) { |
| | | _customScript && console.info(`${setting.$name ? `/*${setting.$name} 自定义脚本 统计查询*/\n` : ''}${LText ? '' : '/*不执行默认sql*/\n'}${_customScript}`) |
| | | LText && console.info(`${setting.$name ? `/*${setting.$name} 数据源 统计查询*/\n` : ''}` + LText.replace(/\n\s{8}/ig, '\n')) |
| | | } |
| | |
| | | _script = _script.replace(/@typename@/ig, `'admin'`) |
| | | |
| | | // 测试系统打印查询语句 |
| | | if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) { |
| | | if (window.GLOB.debugger === true) { |
| | | _script && console.info(`${item.$name ? `/*${item.$name} 自定义脚本(同步查询)*/\n` : ''}${_sql ? '' : '/*不执行默认sql*/\n'}${_script}`) |
| | | _sql && console.info(`${item.$name ? `/*${item.$name} 数据源(同步查询)*/\n` : ''}` + _sql) |
| | | } |
| | |
| | | _sqlBottom = _sqlBottom.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'') |
| | | } |
| | | |
| | | if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) { |
| | | if (window.GLOB.debugger === true) { |
| | | let fsql = ` |
| | | ${_sql} |
| | | ${_sqlInsert} |
| | |
| | | _sqlBottom = _sqlBottom.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'') |
| | | } |
| | | |
| | | if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) { |
| | | if (window.GLOB.debugger === true) { |
| | | let fsql = ` |
| | | ${_sql} |
| | | ${_sqlInsert} |
| | |
| | | _sql = _sql.replace(/@datam@/ig, '\'\'') |
| | | } |
| | | |
| | | if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) { |
| | | if (window.GLOB.debugger === true) { |
| | | // _sql = _sql.replace(/\n\s{8}/ig, '\n') |
| | | console.info(_sql) |
| | | } |
| | |
| | | BID: '', |
| | | data: '', |
| | | tempId: '', |
| | | pageId: '', |
| | | config: null, |
| | | urlParam: null, |
| | | visible: false, |
| | | rePos: false, |
| | | loading: false, |
| | | auto: true |
| | | } |
| | | |
| | |
| | | this.setState({ |
| | | BID: param.id || '', |
| | | tempId: param.tempId, |
| | | urlParam: param |
| | | urlParam: param, |
| | | pageId: param.pageId || '' |
| | | }, () => { |
| | | setTimeout(() => { |
| | | this.getMenuParam() |
| | |
| | | componentDidMount() { |
| | | const _this = this |
| | | |
| | | Object.defineProperty(window, 'debug', { |
| | | configurable: true, |
| | | enumerable: true, |
| | | set(value) { |
| | | if (value + '' === 'false') { |
| | | window.debugger = false |
| | | window.GLOB.breakpoint = false |
| | | sessionStorage.removeItem('breakpoint') |
| | | } else { |
| | | window.debugger = true |
| | | window.GLOB.breakpoint = value + '' |
| | | sessionStorage.setItem('breakpoint', value) |
| | | if (window.GLOB.sysType !== 'cloud') { |
| | | Object.defineProperty(window, 'debugger', { |
| | | configurable: true, |
| | | enumerable: true, |
| | | set(value) { |
| | | if (value + '' === 'false') { |
| | | window.GLOB.debugger = false |
| | | } else { |
| | | window.GLOB.debugger = true |
| | | } |
| | | } |
| | | _this.debugChange() |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | Object.defineProperty(window, 'debug', { |
| | | configurable: true, |
| | | enumerable: true, |
| | | set(value) { |
| | | if (value + '' === 'false') { |
| | | window.GLOB.debugger = false |
| | | window.GLOB.breakpoint = false |
| | | sessionStorage.removeItem('breakpoint') |
| | | } else { |
| | | window.GLOB.debugger = true |
| | | window.GLOB.breakpoint = value + '' |
| | | sessionStorage.setItem('breakpoint', value) |
| | | } |
| | | _this.debugChange() |
| | | } |
| | | }) |
| | | } |
| | | |
| | | document.onkeydown = (event) => { |
| | | let e = event || window.event |
| | |
| | | let _shortcut = `${preKey}+${keyCode}` |
| | | |
| | | if (window.GLOB.breakpoint && _shortcut === 'ctrl+67') { |
| | | window.debugger = false |
| | | window.GLOB.breakpoint = false |
| | | sessionStorage.removeItem('breakpoint') |
| | | |
| | |
| | | } |
| | | |
| | | // 测试系统打印查询语句 |
| | | if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) { |
| | | if (window.GLOB.debugger === true) { |
| | | _customScript && console.info(`${_dataresource ? '' : '/*不执行默认sql*/\n'}${_customScript}`) |
| | | _dataresource && console.info(_dataresource) |
| | | } |
| | |
| | | } |
| | | |
| | | print = () => { |
| | | const { config, printing } = this.state |
| | | const { config, printing, BID, tempId, pageId } = this.state |
| | | |
| | | if (printing) return |
| | | |
| | | this.setState({printing: true}) |
| | | |
| | | if (config.callback === 'true') { |
| | | this.setState({loading: true}) |
| | | |
| | | Api.genericInterface({ |
| | | func: 's_print_proc', |
| | | username: sessionStorage.getItem('User_Name') || '', |
| | | fullname: sessionStorage.getItem('Full_Name') || '', |
| | | BID: BID || '', |
| | | print_type: config.callNo || '', |
| | | MenuNo: config.MenuNo || '', |
| | | Menuid: tempId || '' |
| | | }).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | |
| | | this.setState({printing: false, loading: false}) |
| | | return |
| | | } |
| | | |
| | | this.setState({loading: false}) |
| | | |
| | | if (pageId) { |
| | | localStorage.setItem('menuUpdate', new Date().getTime() + ',' + pageId + ',menu') |
| | | } |
| | | |
| | | setTimeout(() => { |
| | | this.execPrint() |
| | | }, 300) |
| | | }) |
| | | } else { |
| | | this.execPrint() |
| | | } |
| | | } |
| | | |
| | | execPrint = () => { |
| | | const { config } = this.state |
| | | |
| | | let qrcodes = document.getElementsByClassName('qrcode-box') |
| | | |
| | |
| | | } |
| | | |
| | | let jubuData = document.getElementById('bill-print').innerHTML |
| | | |
| | | this.setState({printing: true}) |
| | | |
| | | try { |
| | | let iframe = document.createElement('IFRAME') |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { loadingview, viewlost, config, pages, auto, rePos } = this.state |
| | | const { loadingview, viewlost, config, pages, auto, rePos, loading } = this.state |
| | | |
| | | return ( |
| | | <div className="bill-print-wrap" > |
| | | {loadingview && <Spin size="large" />} |
| | | {loadingview || loading ? <Spin size="large" /> : null} |
| | | {pages ? <div id="bill-print"> |
| | | {pages.map((components, index) => (<div className={'print-page' + (auto ? ' auto' : '') + (rePos ? ' reset-position' : '')} key={index} style={{...config.style, overflow: 'hidden', boxSizing: 'border-box'}}><Row className="component-wrap">{this.getComponents(components)}</Row></div>))} |
| | | </div> : null} |
| | |
| | | window.location.reload() |
| | | } else { |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | window.debugger = false |
| | | window.GLOB.breakpoint = false |
| | | window.GLOB.designView = true |
| | | sessionStorage.removeItem('breakpoint') |
| | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('resetSelectLine', this.resetParentParam) |
| | | |
| | | Object.defineProperty(window, 'debug', { |
| | | configurable: true, |
| | | enumerable: true, |
| | | set(value) { |
| | | if (value + '' === 'false') { |
| | | window.debugger = false |
| | | window.GLOB.breakpoint = false |
| | | sessionStorage.removeItem('breakpoint') |
| | | } else { |
| | | window.debugger = true |
| | | window.GLOB.breakpoint = value + '' |
| | | sessionStorage.setItem('breakpoint', value) |
| | | if (window.GLOB.sysType !== 'cloud') { |
| | | Object.defineProperty(window, 'debugger', { |
| | | configurable: true, |
| | | enumerable: true, |
| | | set(value) { |
| | | if (value + '' === 'false') { |
| | | window.GLOB.debugger = false |
| | | } else { |
| | | window.GLOB.debugger = true |
| | | } |
| | | } |
| | | MKEmitter.emit('debugChange') |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | Object.defineProperty(window, 'debug', { |
| | | configurable: true, |
| | | enumerable: true, |
| | | set(value) { |
| | | if (value + '' === 'false') { |
| | | window.GLOB.debugger = false |
| | | window.GLOB.breakpoint = false |
| | | sessionStorage.removeItem('breakpoint') |
| | | } else { |
| | | window.GLOB.debugger = true |
| | | window.GLOB.breakpoint = value + '' |
| | | sessionStorage.setItem('breakpoint', value) |
| | | } |
| | | MKEmitter.emit('debugChange') |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | |
| | | checkBase = () => { |
| | | const { MenuType, config } = this.state |
| | | |
| | | if (MenuType === 'billPrint' && config.printPage === 'page' && !config.everyPCount) { |
| | | if (MenuType === 'billPrint' && ((config.printPage === 'page' && !config.everyPCount) || (config.callback === 'true' && !config.callNo))) { |
| | | return false |
| | | } else if (MenuType === 'home' && (config.cacheUseful === 'true' && !config.cacheTime)) { |
| | | return false |
| | |
| | | }) |
| | | } |
| | | |
| | | // 一二级菜单切换 |
| | | selectChange = (key, value) => { |
| | | const { config } = this.props |
| | | const { menulist } = this.state |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, InputNumber, Select, Radio, Tooltip } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import { Form, Row, Col, InputNumber, Select, Radio, Tooltip, Input } from 'antd' |
| | | import { QuestionCircleOutlined, EditOutlined } from '@ant-design/icons' |
| | | |
| | | // import './index.scss' |
| | | |
| | |
| | | updateConfig: PropTypes.func |
| | | } |
| | | |
| | | changeCount = (val) => { |
| | | if (typeof(val) !== 'number') { |
| | | val = '' |
| | | selectChange = (key, value) => { |
| | | const { config } = this.props |
| | | |
| | | if (['everyPCount', 'printWidth', 'printHeight'].includes(key)) { |
| | | if (typeof(value) !== 'number') { |
| | | value = '' |
| | | } |
| | | } else if (key === 'callNo') { |
| | | if (!/^[a-zA-Z0-9_]+$/.test(value)) { |
| | | value = '' |
| | | } |
| | | } |
| | | this.props.updateConfig({...this.props.config, everyPCount: val}) |
| | | } |
| | | |
| | | changePrintWidth = (val) => { |
| | | if (typeof(val) !== 'number') { |
| | | val = '' |
| | | this.props.updateConfig({...config, [key]: value}) |
| | | |
| | | if (['pageSize', 'pageLayout', 'pagePadding', 'printCustom'].includes(key)) { |
| | | this.resetPage() |
| | | } |
| | | this.props.updateConfig({...this.props.config, printWidth: val}) |
| | | } |
| | | |
| | | changePrintHeight = (val) => { |
| | | if (typeof(val) !== 'number') { |
| | | val = '' |
| | | } |
| | | this.props.updateConfig({...this.props.config, printHeight: val}) |
| | | } |
| | | |
| | | onPrintPageChange = (val) => { |
| | | this.props.updateConfig({...this.props.config, printPage: val}) |
| | | } |
| | | |
| | | pageSizeChange = (val) => { |
| | | this.props.updateConfig({...this.props.config, pageSize: val}) |
| | | this.resetPage() |
| | | } |
| | | |
| | | onLayoutChange = (val) => { |
| | | this.props.updateConfig({...this.props.config, pageLayout: val}) |
| | | this.resetPage() |
| | | } |
| | | |
| | | onPaddingChange = (val) => { |
| | | this.props.updateConfig({...this.props.config, pagePadding: val}) |
| | | this.resetPage() |
| | | } |
| | | |
| | | onPrintCustomChange = (val) => { |
| | | this.props.updateConfig({...this.props.config, printCustom: val}) |
| | | this.resetPage() |
| | | } |
| | | |
| | | resetPage = () => { |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <Select onChange={this.pageSizeChange}> |
| | | <Select onChange={(val) => this.selectChange('pageSize', val)}> |
| | | <Select.Option value="A3">A3</Select.Option> |
| | | <Select.Option value="A4">A4</Select.Option> |
| | | <Select.Option value="A5">A5</Select.Option> |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.onLayoutChange(e.target.value)}}> |
| | | <Radio.Group onChange={(e) => this.selectChange('pageLayout', e.target.value)}> |
| | | <Radio value="vertical">纵向</Radio> |
| | | <Radio value="horizontal">横向</Radio> |
| | | </Radio.Group> |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.onPaddingChange(e.target.value)}}> |
| | | <Radio.Group onChange={(e) => this.selectChange('pagePadding', e.target.value)}> |
| | | <Radio value="default">默认</Radio> |
| | | <Radio value="without">无</Radio> |
| | | </Radio.Group> |
| | |
| | | {getFieldDecorator('printPage', { |
| | | initialValue: config.printPage || 'auto' |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.onPrintPageChange(e.target.value)}}> |
| | | <Radio.Group onChange={(e) => this.selectChange('printPage', e.target.value)}> |
| | | <Radio value="auto">自适应</Radio> |
| | | <Radio value="page">分页</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {/* <Col span={24}> |
| | | <Form.Item label="首页数(条)"> |
| | | {getFieldDecorator('firstCount', { |
| | | initialValue: config.firstCount, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入首页数!' |
| | | } |
| | | ] |
| | | })(<InputNumber min={1} max={1000} precision={1} onChange={this.changeFirstCount}/>)} |
| | | </Form.Item> |
| | | </Col> */} |
| | | {config.printPage === 'page' ? <Col span={24}> |
| | | <Form.Item label="每页数(条)"> |
| | | {getFieldDecorator('everyPCount', { |
| | |
| | | message: '请输入每页数!' |
| | | } |
| | | ] |
| | | })(<InputNumber min={1} max={1000} precision={1} onChange={this.changeCount}/>)} |
| | | })(<InputNumber min={1} max={1000} precision={1} onChange={(val) => this.selectChange('everyPCount', val)}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {/* <Col span={24}> |
| | | <Form.Item label="尾页数(条)"> |
| | | {getFieldDecorator('lastCount', { |
| | | initialValue: config.lastCount |
| | | })(<InputNumber min={1} max={1000} precision={1} onChange={this.changeLastCount}/>)} |
| | | </Form.Item> |
| | | </Col> */} |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="针对不规则纸张,可自定义设置打印高度和宽度,注:同时设置打印宽度和高度后方可生效。"> |
| | |
| | | {getFieldDecorator('printCustom', { |
| | | initialValue: config.printCustom || 'false' |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.onPrintCustomChange(e.target.value)}}> |
| | | <Radio.Group onChange={(e) => this.selectChange('printCustom', e.target.value)}> |
| | | <Radio value="false">不启用</Radio> |
| | | <Radio value="true">启用</Radio> |
| | | </Radio.Group> |
| | |
| | | <Form.Item label="打印宽度"> |
| | | {getFieldDecorator('printWidth', { |
| | | initialValue: config.printWidth || '' |
| | | })(<InputNumber min={10} max={9999} precision={0} onChange={this.changePrintWidth}/>)} |
| | | })(<InputNumber min={10} max={9999} precision={0} onChange={(val) => this.selectChange('printWidth', val)}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {config.printCustom === 'true' ? <Col span={24}> |
| | | <Form.Item label="打印高度"> |
| | | {getFieldDecorator('printHeight', { |
| | | initialValue: config.printHeight || '' |
| | | })(<InputNumber min={10} max={9999} precision={0} onChange={this.changePrintHeight}/>)} |
| | | })(<InputNumber min={10} max={9999} precision={0} onChange={(val) => this.selectChange('printHeight', val)}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={24}> |
| | | <Form.Item label="回调"> |
| | | {getFieldDecorator('callback', { |
| | | initialValue: config.callback || 'false' |
| | | })( |
| | | <Radio.Group onChange={(e) => this.selectChange('callback', e.target.value)}> |
| | | <Radio value="false">不启用</Radio> |
| | | <Radio value="true">启用</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {config.callback === 'true' ? <Col span={24}> |
| | | <Form.Item label="回调函数"> |
| | | s_print_proc <EditOutlined style={{cursor: 'pointer'}} onClick={() => {window.open('#/proc/s_print_proc')}}/> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {config.callback === 'true' ? <Col span={24}> |
| | | <Form.Item label="回调参数"> |
| | | {getFieldDecorator('callNo', { |
| | | initialValue: config.callNo || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请填写回调参数!' |
| | | }, |
| | | { |
| | | pattern: /^[a-zA-Z0-9_]+$/, |
| | | message: '回调参数只可使用字母、数字以及_' |
| | | } |
| | | ] |
| | | })(<Input onChange={(e) => this.selectChange('callNo', e.target.value)}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | </Row> |
| | |
| | | |
| | | if (/^\/view\//.test(path)) { |
| | | localStorage.setItem('getSysPermission', window.GLOB.appkey) |
| | | const that = this |
| | | |
| | | window.addEventListener('storage', function(event) { |
| | | if (event.key === 'sysPermissions' && event.newValue) { |
| | |
| | | |
| | | window.GLOB.mkThdMenus = values.mkThdMenus |
| | | window.GLOB.mkActions = values.mkActions |
| | | } else if (event.key === 'menuUpdate') { |
| | | let vals = event.newValue.split(',') |
| | | let MenuId = vals[1] |
| | | let position = vals[2] || '' |
| | | if (position === 'menu' && menuId === MenuId) { |
| | | that.setState({loading: true}, () => { |
| | | that.setState({loading: false}) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | |
| | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('modifyTabs', this.modifyTabs) |
| | | MKEmitter.addListener('closeTabView', this.closeTabView) |
| | | |
| | | if (window.GLOB.sysType !== 'cloud') { |
| | | Object.defineProperty(window, 'debugger', { |
| | | configurable: true, |
| | | enumerable: true, |
| | | set(value) { |
| | | if (value + '' === 'false') { |
| | | window.GLOB.debugger = false |
| | | } else { |
| | | window.GLOB.debugger = true |
| | | } |
| | | } |
| | | }) |
| | | |
| | | Object.defineProperty(window, 'debug', { |
| | | configurable: true, |
| | | enumerable: true, |
| | | set(value) { |
| | | if (value + '' === 'false') { |
| | | window.GLOB.debugger = false |
| | | window.GLOB.breakpoint = false |
| | | sessionStorage.removeItem('breakpoint') |
| | | } else { |
| | | window.GLOB.debugger = true |
| | | window.GLOB.breakpoint = value + '' |
| | | sessionStorage.setItem('breakpoint', value) |
| | | } |
| | | MKEmitter.emit('debugChange') |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | class SysProc extends Component { |
| | | render () { |
| | | const { params } = this.props.match |
| | | let func = params && params.func ? params.func : '' |
| | | |
| | | return ( |
| | | <div className="mk-proc-view"> |
| | | <ConfigProvider locale={zhCN}> |
| | | <Header key="header"/> |
| | | <Proc /> |
| | | <Proc func={func} /> |
| | | </ConfigProvider> |
| | | </div> |
| | | ) |
| | |
| | | |
| | | class ProcControl extends Component { |
| | | state = { |
| | | procName: '', |
| | | procName: this.props.func || '', |
| | | content: '', |
| | | loading: false, |
| | | visible: false, |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (this.props.func) { |
| | | setTimeout(() => { |
| | | this.search(this.props.func) |
| | | }, 500) |
| | | } |
| | | } |
| | | |
| | | search = (value) => { |