| | |
| | | token = JSON.parse(window.decodeURIComponent(window.atob(token))) |
| | | } catch (e) { |
| | | token = null |
| | | _resolve({status: false, ErrCode: 'E', message: '接口信息解析失败!'}) |
| | | _resolve({status: false, ErrCode: 'E', message: '接口信息解析失败!', ErrMesg: 'token_error'}) |
| | | } |
| | | |
| | | if (!token) return |
| | |
| | | param.appkey = window.GLOB.appkey || '' |
| | | |
| | | if (param.$token === '') { |
| | | return Promise.resolve({status: false, ErrCode: 'E', message: '接口地址尚未设置!'}) |
| | | return Promise.resolve({status: false, ErrCode: 'E', message: '接口地址尚未设置!', ErrMesg: 'token_error'}) |
| | | } else if (param.$token) { |
| | | return new Promise(resolve => this.visitOuterSystem(param, resolve)) |
| | | } |
| | |
| | | } |
| | | } else { |
| | | btn.style = item.style || {} |
| | | if (btn.class !== item.class || btn.show !== item.show || !btn.style.color || item.focus) { |
| | | if (btn.show === 'icon') { |
| | | btn.style.color = color[btn.class] |
| | | btn.style.backgroundColor = 'transparent' |
| | | } else if (btn.class === 'default') { |
| | | btn.style.color = 'rgba(0, 0, 0, 0.65)' |
| | | btn.style.backgroundColor = '#fff' |
| | | btn.style.borderColor = '#d9d9d9' |
| | | } else if (btn.class.indexOf('border') > -1) { |
| | | let _c = btn.class.replace('border-', '') |
| | | btn.style.color = color[_c] |
| | | btn.style.backgroundColor = '#fff' |
| | | btn.style.borderColor = color[_c] |
| | | } else if (btn.class === 'gray') { |
| | | btn.style.color = 'rgba(0, 0, 0, 0.65)' |
| | | btn.style.backgroundColor = color[btn.class] |
| | | btn.style.borderColor = color[btn.class] |
| | | } else { |
| | | btn.style.color = '#ffffff' |
| | | btn.style.backgroundColor = color[btn.class] |
| | | btn.style.borderColor = color[btn.class] |
| | | if (btn.class) { |
| | | if (btn.class !== item.class || btn.show !== item.show || !btn.style.color || item.focus) { |
| | | if (btn.show === 'icon') { |
| | | btn.style.color = color[btn.class] |
| | | btn.style.backgroundColor = 'transparent' |
| | | } else if (btn.class === 'default') { |
| | | btn.style.color = 'rgba(0, 0, 0, 0.65)' |
| | | btn.style.backgroundColor = '#fff' |
| | | btn.style.borderColor = '#d9d9d9' |
| | | } else if (btn.class.indexOf('border') > -1) { |
| | | let _c = btn.class.replace('border-', '') |
| | | btn.style.color = color[_c] |
| | | btn.style.backgroundColor = '#fff' |
| | | btn.style.borderColor = color[_c] |
| | | } else if (btn.class === 'gray') { |
| | | btn.style.color = 'rgba(0, 0, 0, 0.65)' |
| | | btn.style.backgroundColor = color[btn.class] |
| | | btn.style.borderColor = color[btn.class] |
| | | } else { |
| | | btn.style.color = '#ffffff' |
| | | btn.style.backgroundColor = color[btn.class] |
| | | btn.style.borderColor = color[btn.class] |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | 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) |
| | | let r = SettingUtils.getDebugSql(setting, _scripts, columns, searches, defaultSearch, '2023-04-20 15:29:37') |
| | | |
| | | let _debugId = md5(r.sql) |
| | | |
| | |
| | | |
| | | render () { |
| | | const { btn } = this.props |
| | | const { config, saving } = this.state |
| | | const { config, saving, card } = this.state |
| | | |
| | | return ( |
| | | <div className="modal-form-board"> |
| | |
| | | </div> |
| | | </DndProvider> |
| | | <Modal |
| | | title="编辑" |
| | | title={card && card.$copy ? '复制' : '编辑'} |
| | | visible={this.state.visible} |
| | | width={950} |
| | | maskClosable={false} |
| | |
| | | destroyOnClose |
| | | > |
| | | <ModalForm |
| | | card={this.state.card} |
| | | card={card} |
| | | formlist={this.state.formlist} |
| | | inputSubmit={this.handleSubmit} |
| | | standardform={this.state.standardform} |
| | |
| | | let val = JSON.parse(JSON.stringify(_card)) |
| | | val.copyType = 'form' |
| | | |
| | | _card.$copy = true |
| | | |
| | | delete val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | |
| | | |
| | | render () { |
| | | const { btn } = this.props |
| | | const { config, saving } = this.state |
| | | const { config, saving, card } = this.state |
| | | |
| | | return ( |
| | | <div className="mob-form-board"> |
| | |
| | | </div> |
| | | </DndProvider> |
| | | <Modal |
| | | title="编辑" |
| | | title={card && card.$copy ? '复制' : '编辑'} |
| | | visible={this.state.visible} |
| | | width={950} |
| | | maskClosable={false} |
| | |
| | | destroyOnClose |
| | | > |
| | | <ModalForm |
| | | card={this.state.card} |
| | | card={card} |
| | | formlist={this.state.formlist} |
| | | inputSubmit={this.handleSubmit} |
| | | standardform={this.state.standardform} |
| | |
| | | import React, {Component} from 'react' |
| | | import {HashRouter, Switch, Route, Redirect} from 'react-router-dom' |
| | | import md5 from 'md5' |
| | | import moment from 'moment' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncLoadComponent from '@/utils/asyncLoadComponent' |
| | | |
| | |
| | | const SystemProc = asyncLoadComponent(() => import('@/views/systemproc')) |
| | | |
| | | const routers = [ |
| | | {path: '/login', name: 'login', component: Login, auth: false}, |
| | | {path: '/main', name: 'main', component: Main, auth: true}, |
| | | {path: '/pay/:param', name: 'pay', component: Pay, auth: false}, |
| | | {path: '/print/:param', name: 'print', component: PrintT, auth: false}, |
| | | {path: '/ssologin/:param', name: 'ssologin', component: Sso, auth: false}, |
| | | {path: '/design', name: 'design', component: Design, auth: true}, |
| | | {path: '/appmanage', name: 'appmanage', component: AppManage, auth: true}, |
| | | {path: '/appcheck', name: 'appcheck', component: AppCheck, auth: true}, |
| | | {path: '/pcdesign/:param', name: 'pcdesign', component: PCDesign, auth: true}, |
| | | {path: '/mobdesign/:param', name: 'mobdesign', component: MobDesign, auth: true}, |
| | | {path: '/imdesign/:param', name: 'imdesign', component: ImDesign, auth: true}, |
| | | {path: '/menudesign/:param', name: 'menudesign', component: MenuDesign, auth: true}, |
| | | {path: '/basedesign/:param', name: 'basedesign', component: BaseDesign, auth: true}, |
| | | {path: '/tabledesign/:param', name: 'tabledesign', component: TableDesign, auth: true}, |
| | | {path: '/billprint/:param', name: 'billprint', component: BillPrint, auth: true}, |
| | | {path: '/docprint/:menuId', name: 'docprint', component: BillPrint, auth: false}, |
| | | {path: '/docprint/:menuId/:id', name: 'docprint', component: BillPrint, auth: false}, |
| | | {path: '/tab/:menuId', name: 'tab', component: MainParams, auth: false}, |
| | | {path: '/role/:param', name: 'role', component: RoleManage, auth: true}, |
| | | {path: '/hs', name: 'hs', component: SystemFunc, auth: true}, |
| | | {path: '/proc', name: 'proc', component: SystemProc, auth: true}, |
| | | {path: '/interface', name: 'interface', component: Interface, auth: true} |
| | | {path: '/login', name: 'login', component: Login}, |
| | | {path: '/main', name: 'main', component: Main}, |
| | | {path: '/pay/:param', name: 'pay', component: Pay}, |
| | | {path: '/print/:param', name: 'print', component: PrintT}, |
| | | {path: '/ssologin/:param', name: 'ssologin', component: Sso}, |
| | | {path: '/design', name: 'design', component: Design}, |
| | | {path: '/appmanage', name: 'appmanage', component: AppManage}, |
| | | {path: '/appcheck', name: 'appcheck', component: AppCheck}, |
| | | {path: '/pcdesign/:param', name: 'pcdesign', component: PCDesign}, |
| | | {path: '/mobdesign/:param', name: 'mobdesign', component: MobDesign}, |
| | | {path: '/imdesign/:param', name: 'imdesign', component: ImDesign}, |
| | | {path: '/menudesign/:param', name: 'menudesign', component: MenuDesign}, |
| | | {path: '/basedesign/:param', name: 'basedesign', component: BaseDesign}, |
| | | {path: '/tabledesign/:param', name: 'tabledesign', component: TableDesign}, |
| | | {path: '/billprint/:param', name: 'billprint', component: BillPrint}, |
| | | {path: '/docprint/:menuId', name: 'docprint', component: BillPrint}, |
| | | {path: '/docprint/:menuId/:id', name: 'docprint', component: BillPrint}, |
| | | {path: '/tab/:menuId', name: 'tab', component: MainParams}, |
| | | {path: '/role/:param', name: 'role', component: RoleManage}, |
| | | {path: '/hs', name: 'hs', component: SystemFunc}, |
| | | {path: '/proc', name: 'proc', component: SystemProc}, |
| | | {path: '/interface', name: 'interface', component: Interface} |
| | | ] |
| | | |
| | | export default class RouteConfig extends Component { |
| | | controlRoute (item, props) { |
| | | if (!item.auth) { // 不需要授权,直接跳转 |
| | | return (<item.component {...props}/>) |
| | | } |
| | | |
| | | let userId = sessionStorage.getItem('UserID') // 判断登录信息是否存在,注用户可能保存主页链接 |
| | | let authCode = localStorage.getItem(window.location.href.split('#')[0] + 'AuthCode') // 判断系统是否在授权期限内 |
| | | let _s = md5('mksoft' + moment().format('YYYYMMDD')) |
| | | let isauth = authCode && authCode.includes(_s) |
| | | let key = md5(window.GLOB.appId + 'minke_software' + window.GLOB.appkey).toUpperCase().substr(-6) |
| | | let key1 = window.GLOB.licenseKey ? window.GLOB.licenseKey.substring(0, 6) : '' |
| | | |
| | | if (key1 === key) { |
| | | isauth = true |
| | | } |
| | | |
| | | if (userId && isauth) { |
| | | return (<item.component {...props}/>) |
| | | } else { |
| | | return (<Redirect to={{ pathname: '/login'}}/>) |
| | | } |
| | | } |
| | | |
| | | render () { |
| | | return ( |
| | | <HashRouter> |
| | | <Switch> |
| | | {routers.map((item, index) => <Route key={index} path={item.path} name={item.name} exact render={ props => this.controlRoute(item, props)}/>)} |
| | | {routers.map((item, index) => <Route key={index} path={item.path} name={item.name} exact render={ props => <item.component {...props}/>}/>)} |
| | | <Redirect exact from="/" to="login"/> |
| | | <Route component= {NotFound}/> |
| | | </Switch> |
| | |
| | | }) |
| | | } else if (btn.intertype === 'outer') { // 外部接口 |
| | | let _outParam = null |
| | | let ver_token = false |
| | | |
| | | new Promise(resolve => { |
| | | // 内部请求 |
| | |
| | | } else { |
| | | param.$token = btn.exInterface || '' |
| | | } |
| | | ver_token = true |
| | | } else { |
| | | if (window.GLOB.systemType === 'production' && btn.proInterface) { |
| | | param.rduri = btn.proInterface |
| | |
| | | }).then(response => { |
| | | if (!response) return |
| | | // 回调请求 |
| | | if (btn.callbackFunc) { |
| | | if (ver_token && response.ErrMesg === 'token_error') { |
| | | this.execError(response) |
| | | } else if (btn.callbackFunc ) { |
| | | // 存在回调函数时,调用 |
| | | delete response.message |
| | | delete response.status |
| | |
| | | outerOuterRequest = (params, result, record, _resolve) => { |
| | | const { btn } = this.props |
| | | let outParam = JSON.parse(JSON.stringify(result)) |
| | | let ver_token = false |
| | | |
| | | if (btn.outerFunc) { |
| | | result.func = btn.outerFunc |
| | |
| | | } else { |
| | | result.$token = btn.exInterface || '' |
| | | } |
| | | ver_token = true |
| | | } else { |
| | | if (window.GLOB.systemType === 'production' && btn.proInterface) { |
| | | result.rduri = btn.proInterface |
| | |
| | | |
| | | Api.genericInterface(result).then(res => { |
| | | if (!res) return // LoginError时中断请求 |
| | | if (ver_token && res.ErrMesg === 'token_error') { |
| | | this.execError(res) |
| | | return |
| | | } |
| | | this.outerCallbackRequest(params, res, record, outParam, _resolve) |
| | | }, () => { |
| | | this.outerCallbackRequest(params, {status: false, message: 500, ErrCode: 'E', ErrMesg: 500}, record, outParam, _resolve) |
| | |
| | | printOuterLoopRequest = (params, btn, _list, _resolve) => { |
| | | let param = params.shift() |
| | | let _outParam = null |
| | | let ver_token = false |
| | | |
| | | new Promise(resolve => { |
| | | // 内部请求 |
| | |
| | | } else { |
| | | res.$token = btn.exInterface || '' |
| | | } |
| | | ver_token = true |
| | | } else { |
| | | if (window.GLOB.systemType === 'production' && btn.proInterface) { |
| | | res.rduri = btn.proInterface |
| | |
| | | }).then(response => { |
| | | if (!response) return |
| | | |
| | | if (btn.callbackFunc) { |
| | | if (ver_token && response.ErrMesg === 'token_error') { |
| | | this.execError(response) |
| | | _resolve({next: false, list: []}) |
| | | } else if (btn.callbackFunc) { |
| | | // 存在回调函数时,调用 |
| | | delete response.message |
| | | delete response.status |
| | |
| | | let val = JSON.parse(JSON.stringify(_card)) |
| | | val.copyType = 'form' |
| | | |
| | | _card.$copy = true |
| | | |
| | | delete val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | |
| | | } |
| | | |
| | | let timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | let sql = SettingUtils.getDebugSql(verify, scripts, (verify.useSearch === 'true' ? searches : []), Utils, timestamp) |
| | | let sql = SettingUtils.getDebugSql(verify, scripts, (verify.useSearch === 'true' ? searches : []), Utils, '2023-04-20 15:29:37') |
| | | |
| | | let _debugId = md5(sql) |
| | | |
| | |
| | | const { verify, declareSql, debugId } = this.state |
| | | |
| | | let timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | let sql = SettingUtils.getDebugSql(verify.setting || {}, verify.columns, scripts, declareSql, timestamp) |
| | | let sql = SettingUtils.getDebugSql(verify.setting || {}, verify.columns, scripts, declareSql, '2023-04-20 15:29:37') |
| | | |
| | | let _debugId = md5(sql) |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | let _href = window.location.href.split('#')[0] |
| | | localStorage.setItem(_href + 'sql_char', JSON.stringify([res.origin, res.value])) |
| | | |
| | | _sql = _sql.replace(reg, res.value) |
| | | |
| | | this.setState({display: false, defaultVal: _sql}, () => { |
| | |
| | | inputSubmit: PropTypes.func // 回车事件 |
| | | } |
| | | |
| | | state = { |
| | | orivalue: '', |
| | | value: '' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | let _href = window.location.href.split('#')[0] |
| | | let res = localStorage.getItem(_href + 'sql_char') |
| | | |
| | | if (res) { |
| | | res = JSON.parse(res) |
| | | |
| | | this.setState({ |
| | | orivalue: res[0] || '', |
| | | value: res[1] || '' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | componentDidMount () { |
| | | try { |
| | | let _form = document.getElementById('origin') |
| | |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const { orivalue, value } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | <Col span={24}> |
| | | <Form.Item label="原字符"> |
| | | {getFieldDecorator('origin', { |
| | | initialValue: '', |
| | | initialValue: orivalue, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | <Col span={24}> |
| | | <Form.Item label="替换为"> |
| | | {getFieldDecorator('value', { |
| | | initialValue: '' |
| | | initialValue: value |
| | | })(<Input autoComplete="off" onPressEnter={this.enterPress}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | return cols.map(item => { |
| | | if (item.type === 'colspan') { |
| | | item.subcols = getColumns(item.subcols) |
| | | } else if (item.type === 'custom') { |
| | | item.elements = item.elements.map(cell => { |
| | | cell = this.resetElement(cell) |
| | | return cell |
| | | }) |
| | | } else { |
| | | item.IsSort = 'false' |
| | | } |
| | |
| | | } |
| | | component.cols = getColumns(component.cols) |
| | | component.statFields = [] |
| | | } else if (['card', 'carousel', 'timeline'].includes(component.type)) { |
| | | component.subcards && component.subcards.forEach(card => { |
| | | if (card.style.boxShadow) { |
| | | delete card.style.hShadow |
| | | delete card.style.vShadow |
| | | delete card.style.shadowBlur |
| | | delete card.style.shadowColor |
| | | } |
| | | |
| | | card.elements = card.elements.filter(cell => { |
| | | if (cell.eleType === 'button') return false |
| | | |
| | | cell = this.resetElement(cell) |
| | | |
| | | return true |
| | | }) |
| | | |
| | | if (!card.backElements || card.backElements.length === 0) return |
| | | |
| | | card.backElements = card.backElements.filter(cell => { |
| | | if (cell.eleType === 'button') return false |
| | | |
| | | cell = this.resetElement(cell) |
| | | |
| | | return true |
| | | }) |
| | | }) |
| | | } else if (component.type === 'balcony') { |
| | | component.elements = component.elements.filter(cell => { |
| | | if (cell.eleType === 'button') return false |
| | | |
| | | cell = this.resetElement(cell) |
| | | |
| | | return true |
| | | }) |
| | | } |
| | | |
| | | if (component.wrap && component.wrap.datatype === 'static') { |
| | |
| | | }) |
| | | } |
| | | |
| | | resetElement = (cell) => { |
| | | cell.style = cell.style || {} |
| | | if (['text', 'number', 'formula'].includes(cell.eleType)) { |
| | | cell.innerHeight = cell.innerHeight || 'auto' |
| | | cell.alignItems = cell.height > 1 ? cell.alignItems : '' |
| | | |
| | | if (cell.eleType === 'number' && typeof(cell.decimal) === 'number') { |
| | | cell.round = Math.pow(10, cell.decimal) |
| | | if (cell.format === 'percent') { |
| | | cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 |
| | | } |
| | | } |
| | | } |
| | | |
| | | return cell |
| | | } |
| | | |
| | | reload = () => { |
| | | const { tempId } = this.state |
| | | |