Merge branch 'master' into bms
| | |
| | | "defaultLang": "zh-CN", |
| | | "WXAppID": "", |
| | | "debugger": false, |
| | | "licenseKey": "", |
| | | "licenseKey": "7EFE13KIKKILIJ7C8CFC", |
| | | "probation": "", |
| | | "host": "http://bms-test.kresstools.cn", |
| | | "service": "oc/" |
| | |
| | | border-color: $color6; |
| | | } |
| | | } |
| | | .ant-carousel { |
| | | .slick-dots { |
| | | >li { |
| | | button { |
| | | background-color: $color3; |
| | | } |
| | | } |
| | | >li.slick-active { |
| | | button { |
| | | background-color: $color6; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | body.hidden-split-line #root { // 去除登录页分割线 |
| | |
| | | maskClosable={false} |
| | | okText={dict['model.submit']} |
| | | onOk={this.verifySubmit} |
| | | onCancel={() => { this.setState({ profVisible: false }) }} |
| | | onCancel={() => { |
| | | if (this.verifyRef.handleCancel) { |
| | | this.verifyRef.handleCancel().then(() => { |
| | | this.setState({ profVisible: false }) |
| | | }) |
| | | } else { |
| | | this.setState({ profVisible: false }) |
| | | } |
| | | }} |
| | | destroyOnClose |
| | | > |
| | | {card && !card.execMode && card.OpenType !== 'excelIn' && card.OpenType !== 'excelOut' ? |
| | |
| | | maskClosable={false} |
| | | okText={dict['model.submit']} |
| | | onOk={this.verifySubmit} |
| | | onCancel={() => { this.setState({ profVisible: false }) }} |
| | | onCancel={() => { |
| | | if (this.verifyRef.handleCancel) { |
| | | this.verifyRef.handleCancel().then(() => { |
| | | this.setState({ profVisible: false }) |
| | | }) |
| | | } else { |
| | | this.setState({ profVisible: false }) |
| | | } |
| | | }} |
| | | destroyOnClose |
| | | > |
| | | <VerifyCard |
| | |
| | | maskClosable={false} |
| | | okText={dict['model.submit']} |
| | | onOk={this.verifySubmit} |
| | | onCancel={() => { this.setState({ profVisible: false }) }} |
| | | onCancel={() => { |
| | | if (this.verifyRef.handleCancel) { |
| | | this.verifyRef.handleCancel().then(() => { |
| | | this.setState({ profVisible: false }) |
| | | }) |
| | | } else { |
| | | this.setState({ profVisible: false }) |
| | | } |
| | | }} |
| | | destroyOnClose |
| | | > |
| | | {card && !card.execMode && card.OpenType !== 'excelIn' && card.OpenType !== 'excelOut' ? |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Tabs, Popconfirm, Icon, notification, Modal, Typography, Spin, message } from 'antd' |
| | | import { StopOutlined, CheckCircleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | |
| | | width: '13%', |
| | | render: (text, record) => record.status === 'false' ? |
| | | ( |
| | | <div> |
| | | <div style={{color: '#ff4d4f'}}> |
| | | {this.props.dict['model.status.forbidden']} |
| | | <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" /> |
| | | <StopOutlined style={{marginLeft: '5px'}} /> |
| | | </div> |
| | | ) : |
| | | ( |
| | | <div> |
| | | <div style={{color: '#26C281'}}> |
| | | {this.props.dict['model.status.open']} |
| | | <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" /> |
| | | <CheckCircleOutlined style={{marginLeft: '5px'}}/> |
| | | </div> |
| | | ) |
| | | }, |
| | |
| | | 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 (window.GLOB.licenseKey === key) { |
| | | if (key1 === key) { |
| | | isauth = true |
| | | } |
| | | |
| | |
| | | config: _config, |
| | | arr_field: _config.columns.map(col => col.field).join(','), |
| | | }, () => { |
| | | if (_config.wrap.datatype !== 'static' && _config.setting && _config.setting.sync !== 'true' && _config.setting.onload === 'true') { |
| | | if (_config.wrap.datatype !== 'static' && _config.setting && _config.setting.sync !== 'true') { |
| | | this.loadData() |
| | | } |
| | | }) |
| | |
| | | } else { |
| | | value = [] |
| | | } |
| | | } else if (value) { |
| | | let option = null |
| | | if (config.setAll === 'true') { |
| | | option= config.oriOptions[1] |
| | | } else { |
| | | option= config.oriOptions[0] |
| | | } |
| | | if (typeof(value) === 'string' && option && typeof(option.value) === 'number') { |
| | | value = +value |
| | | if (isNaN(value)) { |
| | | value = config.initval |
| | | } |
| | | } |
| | | } |
| | | |
| | | this.state = { |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { config } = this.state |
| | | const { config, value } = this.state |
| | | |
| | | if (!is(fromJS(config.oriOptions), fromJS(nextProps.config.oriOptions))) { |
| | | this.setState({ |
| | |
| | | this.setState({ |
| | | value: nextProps.config.initval, |
| | | }) |
| | | } else { |
| | | let option = null |
| | | if (config.setAll === 'true') { |
| | | option= nextProps.config.oriOptions[1] |
| | | } else { |
| | | option= nextProps.config.oriOptions[0] |
| | | } |
| | | if (option && typeof(option.value) === 'number') { |
| | | let val = +value |
| | | if (!isNaN(val)) { |
| | | this.setState({ |
| | | value: val |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | this.props.form.validateFields((err, values) => { |
| | | if (err) return |
| | | |
| | | let searches = this.getFieldsValues(values) |
| | | let { searches, error } = this.getFieldsValues(values) |
| | | |
| | | if (this.state.hasReqFields) { |
| | | if (error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: error, |
| | | duration: 3 |
| | | }) |
| | | return |
| | | } else if (this.state.hasReqFields) { |
| | | let requireFields = searches.filter(item => item.required && item.value === '') |
| | | if (requireFields.length > 0) { |
| | | let labels = requireFields.map(item => item.label) |
| | |
| | | |
| | | // 获取搜索条件值 |
| | | let search = [] |
| | | let error = null |
| | | searchlist.forEach(item => { |
| | | if (item.type === 'group') { |
| | | search.push({ |
| | |
| | | }) |
| | | } else { |
| | | let type = item.type |
| | | let val = values[item.field] !== undefined ? values[item.field] : '' |
| | | |
| | | if (type === 'multiselect' || (type === 'checkcard' && item.multiple === 'true')) { |
| | | type = 'multi' |
| | | } else if (type === 'text' && !error) { |
| | | if (/'/ig.test(val)) { |
| | | error = `搜索条件${item.label}中,不可使用英文状态的单引号。` |
| | | } else if (/(^|\s)select\s/ig.test(val)) { |
| | | error = `搜索条件${item.label}中,不可使用关键字select。` |
| | | } else if (/\sfrom(\s|\()/ig.test(val)) { |
| | | error = `搜索条件${item.label}中,不可使用关键字from。` |
| | | } else if (/(^|\s)insert\s/ig.test(val)) { |
| | | error = `搜索条件${item.label}中,不可使用关键字insert。` |
| | | } else if (/(^|\s)delete\s/ig.test(val)) { |
| | | error = `搜索条件${item.label}中,不可使用关键字delete。` |
| | | } else if (/(^|\s)update\s/ig.test(val)) { |
| | | error = `搜索条件${item.label}中,不可使用关键字update。` |
| | | } else if (/(^|\s)where\s/ig.test(val)) { |
| | | error = `搜索条件${item.label}中,不可使用关键字where。` |
| | | } else if (/(^|\s)drop\s/ig.test(val)) { |
| | | error = `搜索条件${item.label}中,不可使用关键字drop。` |
| | | } else if (/(^|\s)exec\s/ig.test(val)) { |
| | | error = `搜索条件${item.label}中,不可使用关键字exec。` |
| | | } else if (/(^|\s)truncate\s/ig.test(val)) { |
| | | error = `搜索条件${item.label}中,不可使用关键字truncate。` |
| | | } else if (/(^|\s)while\s/ig.test(val)) { |
| | | error = `搜索条件${item.label}中,不可使用关键字while。` |
| | | } else if (/(^|\s)for\s/ig.test(val)) { |
| | | error = `搜索条件${item.label}中,不可使用关键字for。` |
| | | } |
| | | } |
| | | let val = values[item.field] !== undefined ? values[item.field] : '' |
| | | |
| | | if (typeof(val) === 'string') { |
| | | val = val.replace(/(^\s*|\s*$)/ig, '') |
| | |
| | | } |
| | | }) |
| | | |
| | | return search |
| | | return {searches: search, error} |
| | | } |
| | | |
| | | handleOk = (values) => { |
| | |
| | | maskClosable={false} |
| | | okText={this.state.dict['model.submit']} |
| | | onOk={this.verifySubmit} |
| | | onCancel={() => { this.setState({ profileVisible: false }) }} |
| | | onCancel={() => { |
| | | if (this.verifyRef.handleCancel) { |
| | | this.verifyRef.handleCancel().then(() => { |
| | | this.setState({ profileVisible: false }) |
| | | }) |
| | | } else { |
| | | this.setState({ profileVisible: false }) |
| | | } |
| | | }} |
| | | destroyOnClose |
| | | > |
| | | <VerifyCard |
| | |
| | | const opacity = isDragging ? 0 : 1 |
| | | |
| | | let hasProfile = false |
| | | let forbidSql = false |
| | | if (['pop', 'prompt', 'exec'].includes(card.OpenType)) { |
| | | hasProfile = true |
| | | if (card.verify && card.verify.default === 'false') { |
| | | forbidSql = true |
| | | } |
| | | } else if (card.OpenType === 'excelIn' || card.OpenType === 'excelOut') { |
| | | hasProfile = true |
| | | if (card.verify && card.verify.default === 'false') { |
| | | forbidSql = true |
| | | } |
| | | } else if (card.funcType === 'print') { |
| | | hasProfile = true |
| | | } |
| | |
| | | key={card.uuid} |
| | | onDoubleClick={() => doubleClickCard(id)} |
| | | > |
| | | {card.label}{card.position === 'grid' && <Icon type="table" />} |
| | | {card.label}{card.position === 'grid' && <Icon type="table" />}{forbidSql && <Icon type="disconnect" />} |
| | | </Button> |
| | | </div> |
| | | </div> |
| | |
| | | maskClosable={false} |
| | | okText={dict['model.submit']} |
| | | onOk={this.verifySubmit} |
| | | onCancel={() => { this.setState({ profVisible: false }) }} |
| | | onCancel={() => { |
| | | if (this.verifyRef.handleCancel) { |
| | | this.verifyRef.handleCancel().then(() => { |
| | | this.setState({ profVisible: false }) |
| | | }) |
| | | } else { |
| | | this.setState({ profVisible: false }) |
| | | } |
| | | }} |
| | | destroyOnClose |
| | | > |
| | | {card && !card.execMode && card.OpenType !== 'excelIn' && card.OpenType !== 'excelOut' ? |
| | |
| | | right: 1px; |
| | | bottom: 0px; |
| | | } |
| | | .anticon-disconnect { |
| | | font-size: 10px; |
| | | position: absolute; |
| | | right: 1px; |
| | | top: 0px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Tabs, Row, Col, Input, Button, Table, Popconfirm, Icon, Tooltip, notification, Modal, message, InputNumber, Radio, Typography } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import { Form, Tabs, Row, Col, Input, Button, Popconfirm, Icon, Tooltip, notification, Modal, message, InputNumber, Radio, Typography } from 'antd' |
| | | import { QuestionCircleOutlined, StopOutlined, CheckCircleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | |
| | | inputType: 'switch', |
| | | render: (text, record) => record.status === 'false' ? |
| | | ( |
| | | <div> |
| | | <div style={{color: '#ff4d4f'}}> |
| | | {this.props.dict['model.status.forbidden']} |
| | | <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" /> |
| | | <StopOutlined style={{marginLeft: '5px'}} /> |
| | | </div> |
| | | ) : |
| | | ( |
| | | <div> |
| | | <div style={{color: '#26C281'}}> |
| | | {this.props.dict['model.status.open']} |
| | | <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" /> |
| | | <CheckCircleOutlined style={{marginLeft: '5px'}}/> |
| | | </div> |
| | | ) |
| | | }, |
| | |
| | | dataIndex: 'position', |
| | | width: '10%', |
| | | render: (text, record) => { |
| | | let _text = '' |
| | | if (record.position === 'front') { |
| | | _text = 'sql前' |
| | | } else if (record.position === 'init') { |
| | | _text = '初始化' |
| | | if (record.position === 'init') { |
| | | return <span style={{color: 'orange'}}>初始化</span> |
| | | } else if (record.position === 'front') { |
| | | return <span style={{color: '#26C281'}}>sql前</span> |
| | | } else { |
| | | _text = 'sql后' |
| | | return <span style={{color: '#1890ff'}}>sql后</span> |
| | | } |
| | | return _text |
| | | } |
| | | }, |
| | | { |
| | |
| | | width: '10%', |
| | | render: (text, record) => record.status === 'false' ? |
| | | ( |
| | | <div> |
| | | <div style={{color: '#ff4d4f'}}> |
| | | {this.props.dict['model.status.forbidden']} |
| | | <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" /> |
| | | <StopOutlined style={{marginLeft: '5px'}} /> |
| | | </div> |
| | | ) : |
| | | ( |
| | | <div> |
| | | <div style={{color: '#26C281'}}> |
| | | {this.props.dict['model.status.open']} |
| | | <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" /> |
| | | <CheckCircleOutlined style={{marginLeft: '5px'}}/> |
| | | </div> |
| | | ) |
| | | }, |
| | | { |
| | | title: '操作', |
| | | align: 'center', |
| | | width: '20%', |
| | | width: '140px', |
| | | dataIndex: 'operation', |
| | | render: (text, record) => |
| | | (<div> |
| | | (<div style={{textAlign: 'center'}}> |
| | | <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><Icon type="edit" /></span> |
| | | <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'scripts', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> |
| | | <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'scripts', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> |
| | | <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> |
| | | <Popconfirm |
| | | overlayClassName="popover-confirm" |
| | |
| | | }) |
| | | } |
| | | |
| | | handleUpDown = (record, type, direction) => { |
| | | let verify = JSON.parse(JSON.stringify(this.state.verify)) |
| | | let index = 0 |
| | | |
| | | if (type === 'columns') { |
| | | verify.columns = verify.columns.filter((item, i) => { |
| | | if (item.uuid === record.uuid) { |
| | | index = i |
| | | } |
| | | |
| | | return item.uuid !== record.uuid |
| | | }) |
| | | if ((index === 0 && direction === 'up') || (index === verify.columns.length && direction === 'down')) { |
| | | return |
| | | } |
| | | |
| | | if (direction === 'up') { |
| | | verify.columns.splice(index - 1, 0, record) |
| | | } else { |
| | | verify.columns.splice(index + 1, 0, record) |
| | | } |
| | | } else if (type === 'unique') { |
| | | verify.uniques = verify.uniques.filter((item, i) => { |
| | | if (item.uuid === record.uuid) { |
| | | index = i |
| | | } |
| | | |
| | | return item.uuid !== record.uuid |
| | | }) |
| | | if ((index === 0 && direction === 'up') || (index === verify.uniques.length && direction === 'down')) { |
| | | return |
| | | } |
| | | |
| | | if (direction === 'up') { |
| | | verify.uniques.splice(index - 1, 0, record) |
| | | } else { |
| | | verify.uniques.splice(index + 1, 0, record) |
| | | } |
| | | } else if (type === 'scripts') { |
| | | verify.scripts = verify.scripts.filter((item, i) => { |
| | | if (item.uuid === record.uuid) { |
| | | index = i |
| | | } |
| | | |
| | | return item.uuid !== record.uuid |
| | | }) |
| | | if ((index === 0 && direction === 'up') || (index === verify.scripts.length && direction === 'down')) { |
| | | return |
| | | } |
| | | |
| | | if (direction === 'up') { |
| | | verify.scripts.splice(index - 1, 0, record) |
| | | } else { |
| | | verify.scripts.splice(index + 1, 0, record) |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | verify: verify |
| | | }) |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { verify } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | |
| | | scriptsChange={this.scriptsChange} |
| | | wrappedComponentRef={(inst) => this.scriptsForm = inst} |
| | | /> |
| | | <Table |
| | | <EditTable actions={['move']} data={verify.scripts} columns={scriptsColumns} onChange={(scripts) => {this.setState({verify: {...verify, scripts}})}}/> |
| | | {/* <Table |
| | | bordered |
| | | rowKey="uuid" |
| | | className="custom-table" |
| | | dataSource={verify.scripts} |
| | | columns={scriptsColumns} |
| | | pagination={false} |
| | | /> |
| | | /> */} |
| | | </TabPane> : null} |
| | | <TabPane tab="信息提示" key="tip"> |
| | | <Form {...formItemLayout}> |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Row, Col, Icon, Button, notification, Select, Popconfirm, Typography, Modal, Radio } from 'antd' |
| | | import { StopOutlined, CheckCircleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | width: '13%', |
| | | render: (text, record) => { |
| | | if (record.position === 'front') { |
| | | return 'sql前' |
| | | return <span style={{color: '#26C281'}}>sql前</span> |
| | | } else { |
| | | return 'sql后' |
| | | return <span style={{color: '#1890ff'}}>sql后</span> |
| | | } |
| | | } |
| | | }, |
| | |
| | | width: '12%', |
| | | render: (text, record) => record.status === 'false' ? |
| | | ( |
| | | <div> |
| | | <div style={{color: '#ff4d4f'}}> |
| | | {this.props.dict['model.status.forbidden']} |
| | | <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" /> |
| | | <StopOutlined style={{marginLeft: '5px'}} /> |
| | | </div> |
| | | ) : |
| | | ( |
| | | <div> |
| | | <div style={{color: '#26C281'}}> |
| | | {this.props.dict['model.status.open']} |
| | | <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" /> |
| | | <CheckCircleOutlined style={{marginLeft: '5px'}}/> |
| | | </div> |
| | | ) |
| | | }, |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Row, Col, Icon, Button, notification, Select, Popconfirm, Typography } from 'antd' |
| | | import { StopOutlined, CheckCircleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | width: '12%', |
| | | render: (text, record) => record.status === 'false' ? |
| | | ( |
| | | <div> |
| | | <div style={{color: '#ff4d4f'}}> |
| | | {this.props.dict['model.status.forbidden']} |
| | | <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" /> |
| | | <StopOutlined style={{marginLeft: '5px'}} /> |
| | | </div> |
| | | ) : |
| | | ( |
| | | <div> |
| | | <div style={{color: '#26C281'}}> |
| | | {this.props.dict['model.status.open']} |
| | | <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" /> |
| | | <CheckCircleOutlined style={{marginLeft: '5px'}}/> |
| | | </div> |
| | | ) |
| | | }, |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Tabs, Row, Col, Radio, Button, Select, Popconfirm, notification, Modal, message, InputNumber, Tooltip, Typography } from 'antd' |
| | | import { QuestionCircleOutlined, CheckCircleOutlined, StopOutlined, EditOutlined, SwapOutlined, DeleteOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | |
| | | inputType: 'switch', |
| | | render: (text, record) => record.status === 'false' ? |
| | | ( |
| | | <div> |
| | | <div style={{color: '#ff4d4f'}}> |
| | | {this.props.dict['model.status.forbidden']} |
| | | <StopOutlined style={{marginLeft: '5px', color: '#ff4d4f'}} /> |
| | | <StopOutlined style={{marginLeft: '5px'}} /> |
| | | </div> |
| | | ) : |
| | | ( |
| | | <div> |
| | | <div style={{color: '#26C281'}}> |
| | | {this.props.dict['model.status.open']} |
| | | <CheckCircleOutlined style={{marginLeft: '5px', color: '#52c41a'}}/> |
| | | <CheckCircleOutlined style={{marginLeft: '5px'}}/> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | inputType: 'switch', |
| | | render: (text, record) => record.status === 'false' ? |
| | | ( |
| | | <div> |
| | | <div style={{color: '#ff4d4f'}}> |
| | | {this.props.dict['model.status.forbidden']} |
| | | <StopOutlined style={{marginLeft: '5px', color: '#ff4d4f'}} /> |
| | | <StopOutlined style={{marginLeft: '5px'}} /> |
| | | </div> |
| | | ) : |
| | | ( |
| | | <div> |
| | | <div style={{color: '#26C281'}}> |
| | | {this.props.dict['model.status.open']} |
| | | <CheckCircleOutlined style={{marginLeft: '5px', color: '#52c41a'}}/> |
| | | <CheckCircleOutlined style={{marginLeft: '5px'}}/> |
| | | </div> |
| | | ) |
| | | }, |
| | |
| | | inputType: 'switch', |
| | | render: (text, record) => record.status === 'false' ? |
| | | ( |
| | | <div> |
| | | <div style={{color: '#ff4d4f'}}> |
| | | {this.props.dict['model.status.forbidden']} |
| | | <StopOutlined style={{marginLeft: '5px', color: '#ff4d4f'}} /> |
| | | <StopOutlined style={{marginLeft: '5px'}} /> |
| | | </div> |
| | | ) : |
| | | ( |
| | | <div> |
| | | <div style={{color: '#26C281'}}> |
| | | {this.props.dict['model.status.open']} |
| | | <CheckCircleOutlined style={{marginLeft: '5px', color: '#52c41a'}}/> |
| | | <CheckCircleOutlined style={{marginLeft: '5px'}}/> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | render: (text) => { |
| | | let title = text.match(/^\s*\/\*.+\*\//) |
| | | title = title && title[0] ? title[0] : '' |
| | | text = title ? text.replace(title, '') : text |
| | | // text = title ? text.replace(title, '') : text |
| | | |
| | | return ( |
| | | <div> |
| | |
| | | width: '9%', |
| | | render: (text, record) => record.status === 'false' ? |
| | | ( |
| | | <div> |
| | | <div style={{color: '#ff4d4f'}}> |
| | | {this.props.dict['model.status.forbidden']} |
| | | <StopOutlined style={{marginLeft: '5px', color: '#ff4d4f'}} /> |
| | | <StopOutlined style={{marginLeft: '5px'}} /> |
| | | </div> |
| | | ) : |
| | | ( |
| | | <div> |
| | | <div style={{color: '#26C281'}}> |
| | | {this.props.dict['model.status.open']} |
| | | <CheckCircleOutlined style={{marginLeft: '5px', color: '#52c41a'}}/> |
| | | <CheckCircleOutlined style={{marginLeft: '5px'}}/> |
| | | </div> |
| | | ) |
| | | }, |
| | |
| | | render: (text) => { |
| | | let title = text.match(/^\s*\/\*.+\*\//) |
| | | title = title && title[0] ? title[0] : '' |
| | | text = title ? text.replace(title, '') : text |
| | | // text = title ? text.replace(title, '') : text |
| | | |
| | | return ( |
| | | <div> |
| | |
| | | width: '10%', |
| | | render: (text, record) => { |
| | | if (record.position === 'init') { |
| | | return '初始化' |
| | | return <span style={{color: 'orange'}}>初始化</span> |
| | | } else if (record.position === 'front') { |
| | | return 'sql前' |
| | | return <span style={{color: '#26C281'}}>sql前</span> |
| | | } else { |
| | | return 'sql后' |
| | | return <span style={{color: '#1890ff'}}>sql后</span> |
| | | } |
| | | } |
| | | }, |
| | |
| | | width: '10%', |
| | | render: (text, record) => record.status === 'false' ? |
| | | ( |
| | | <div> |
| | | <div style={{color: '#ff4d4f'}}> |
| | | {this.props.dict['model.status.forbidden']} |
| | | <StopOutlined style={{marginLeft: '5px', color: '#ff4d4f'}} /> |
| | | <StopOutlined style={{marginLeft: '5px'}} /> |
| | | </div> |
| | | ) : |
| | | ( |
| | | <div> |
| | | <div style={{color: '#26C281'}}> |
| | | {this.props.dict['model.status.open']} |
| | | <CheckCircleOutlined style={{marginLeft: '5px', color: '#52c41a'}}/> |
| | | <CheckCircleOutlined style={{marginLeft: '5px'}}/> |
| | | </div> |
| | | ) |
| | | }, |
| | | { |
| | | title: '操作', |
| | | align: 'center', |
| | | width: '20%', |
| | | width: '140px', |
| | | dataIndex: 'operation', |
| | | render: (text, record) => |
| | | (<div style={{textAlign: 'center'}}> |
| | |
| | | render: (text) => { |
| | | let title = text.match(/^\s*\/\*.+\*\//) |
| | | title = title && title[0] ? title[0] : '' |
| | | text = title ? text.replace(title, '') : text |
| | | // text = title ? text.replace(title, '') : text |
| | | |
| | | return ( |
| | | <div> |
| | |
| | | width: '10%', |
| | | render: (text, record) => { |
| | | if (record.position === 'front') { |
| | | return 'sql前' |
| | | return <span style={{color: '#26C281'}}>sql前</span> |
| | | } else { |
| | | return 'sql后' |
| | | return <span style={{color: '#1890ff'}}>sql后</span> |
| | | } |
| | | } |
| | | }, |
| | |
| | | width: '10%', |
| | | render: (text, record) => record.status === 'false' ? |
| | | ( |
| | | <div> |
| | | <div style={{color: '#ff4d4f'}}> |
| | | {this.props.dict['model.status.forbidden']} |
| | | <StopOutlined style={{marginLeft: '5px', color: '#ff4d4f'}} /> |
| | | <StopOutlined style={{marginLeft: '5px'}} /> |
| | | </div> |
| | | ) : |
| | | ( |
| | | <div> |
| | | <div style={{color: '#26C281'}}> |
| | | {this.props.dict['model.status.open']} |
| | | <CheckCircleOutlined style={{marginLeft: '5px', color: '#52c41a'}}/> |
| | | <CheckCircleOutlined style={{marginLeft: '5px'}}/> |
| | | </div> |
| | | ) |
| | | }, |
| | |
| | | width: '8%', |
| | | render: (text, record) => record.status === 'false' ? |
| | | ( |
| | | <div> |
| | | <div style={{color: '#ff4d4f'}}> |
| | | {this.props.dict['model.status.forbidden']} |
| | | <StopOutlined style={{marginLeft: '5px', color: '#ff4d4f'}} /> |
| | | <StopOutlined style={{marginLeft: '5px'}} /> |
| | | </div> |
| | | ) : |
| | | ( |
| | | <div> |
| | | <div style={{color: '#26C281'}}> |
| | | {this.props.dict['model.status.open']} |
| | | <CheckCircleOutlined style={{marginLeft: '5px', color: '#52c41a'}}/> |
| | | <CheckCircleOutlined style={{marginLeft: '5px'}}/> |
| | | </div> |
| | | ) |
| | | }, |
| | |
| | | }) |
| | | } |
| | | |
| | | _verify.customverifys.forEach((item, i) => { |
| | | item.$index = i + 1 |
| | | }) |
| | | _verify.scripts.forEach((item, i) => { |
| | | item.$index = i + 1 |
| | | }) |
| | | _verify.cbScripts.forEach((item, i) => { |
| | | item.$index = i + 1 |
| | | }) |
| | | |
| | | this.setState({ |
| | | setting: config.setting || {}, |
| | | verify: _verify |
| | | verify: _verify, |
| | | oriVerify: fromJS(_verify).toJS() |
| | | }) |
| | | |
| | | if (config.Template !== 'FormTab' && (card.intertype === 'inner' || card.intertype === 'outer')) { // 内部或外部接口 |
| | |
| | | }) |
| | | } |
| | | |
| | | handleCancel = () => { |
| | | const { verify, oriVerify } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | let msg = '' |
| | | if (this.customForm && this.customForm.state.editItem) { |
| | | msg = '自定义验证' |
| | | } else if (this.customForm && this.customForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.customForm.props.form.getFieldValue('sql'))) { |
| | | msg = '自定义验证' |
| | | } else if (this.orderForm && this.orderForm.state.editItem) { |
| | | msg = '单号生成' |
| | | } else if (this.scriptsForm && this.scriptsForm.state.editItem) { |
| | | msg = '自定义脚本' |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | msg = '自定义脚本' |
| | | } |
| | | |
| | | if (!is(fromJS(verify), fromJS(oriVerify))) { |
| | | confirm({ |
| | | content: '验证信息已修改,确定取消吗?', |
| | | onOk() { |
| | | resolve() |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } else if (msg) { |
| | | confirm({ |
| | | content: msg + '未保存,确定取消吗?', |
| | | onOk() { |
| | | resolve() |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } else { |
| | | resolve() |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | |
| | | padding: 0 5px; |
| | | cursor: pointer; |
| | | } |
| | | .operation-btn:not(:first-child) { |
| | | margin-left: 5px; |
| | | } |
| | | } |
| | |
| | | </Col> |
| | | {typename !== 'pc' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="使用公众号授权登录时,是否需要绑定用户。"> |
| | | <Tooltip placement="topLeft" title="使用公众号授权登录或使用小程序时,是否需要绑定用户。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 用户绑定 |
| | | </Tooltip> |
| | |
| | | |
| | | componentDidMount () { |
| | | if (window.GLOB.systemType !== 'production') { |
| | | Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |
| | | if (res.status) { |
| | | let _permFuncField = [] |
| | | let _sysRoles = [] |
| | | |
| | | if (res.Roles && res.Roles.length > 0) { |
| | | _sysRoles = res.Roles.map(role => { |
| | | return { |
| | | uuid: Utils.getuuid(), |
| | | value: role.RoleID, |
| | | text: role.RoleName |
| | | } |
| | | }) |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |
| | | if (res.status) { |
| | | let _permFuncField = [] |
| | | let _sysRoles = [] |
| | | |
| | | if (res.Roles && res.Roles.length > 0) { |
| | | _sysRoles = res.Roles.map(role => { |
| | | return { |
| | | uuid: Utils.getuuid(), |
| | | value: role.RoleID, |
| | | text: role.RoleName |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (res.sModular && res.sModular.length > 0) { |
| | | res.sModular.forEach(field => { |
| | | if (field.ModularNo) { |
| | | _permFuncField.push(field.ModularNo) |
| | | } |
| | | }) |
| | | _permFuncField = _permFuncField.sort() |
| | | } |
| | | |
| | | sessionStorage.setItem('sysRoles', JSON.stringify(_sysRoles)) |
| | | sessionStorage.setItem('permFuncField', JSON.stringify(_permFuncField)) |
| | | } |
| | | |
| | | if (res.sModular && res.sModular.length > 0) { |
| | | res.sModular.forEach(field => { |
| | | if (field.ModularNo) { |
| | | _permFuncField.push(field.ModularNo) |
| | | } |
| | | }) |
| | | _permFuncField = _permFuncField.sort() |
| | | } |
| | | |
| | | sessionStorage.setItem('sysRoles', JSON.stringify(_sysRoles)) |
| | | sessionStorage.setItem('permFuncField', JSON.stringify(_permFuncField)) |
| | | } |
| | | }) |
| | | }) |
| | | }, 50) |
| | | } else if (window.GLOB.systemType === 'production') { |
| | | this.props.resetEditLevel('HS') |
| | | this.props.modifyMainMenu({ |
| | |
| | | let _s = md5('mksoft' + moment().format('YYYYMMDD')) |
| | | authCode = authCode ? authCode.split(',') : [] |
| | | let index = authCode.findIndex(key => key === _s) |
| | | let license = false |
| | | |
| | | let key = md5(window.GLOB.appId + 'minke_software' + window.GLOB.appkey).toUpperCase().substr(-6) |
| | | if (window.GLOB.licenseKey) { |
| | | if (window.GLOB.licenseKey.length !== 20) { |
| | | Modal.warning({ |
| | | title: `本地授权码已失效,请联系管理员。`, |
| | | okText: '知道了' |
| | | }) |
| | | } else { |
| | | let key = md5(window.GLOB.appId + 'minke_software' + window.GLOB.appkey).toUpperCase().substr(-6) |
| | | |
| | | let key1 = window.GLOB.licenseKey.substring(0, 6) |
| | | let key2 = window.GLOB.licenseKey.substring(6, 14) |
| | | let key3 = window.GLOB.licenseKey.substring(14) |
| | | let key4 = md5(key1 + key2).toUpperCase().substr(-6) |
| | | |
| | | if (key === key1 && key3 === key4) { |
| | | let last = window.GLOB.appkey[window.GLOB.appkey.length - 1] |
| | | let offset = 0 |
| | | let keys = {} |
| | | |
| | | if (!isNaN(+last)) { |
| | | offset = (10 - last) % 10 |
| | | } else { |
| | | last = last.charCodeAt() - 65 |
| | | offset = (30 - last) % 10 |
| | | } |
| | | |
| | | for (let i = 0; i < 26; i++) { |
| | | let char = String.fromCharCode(65 + i) |
| | | keys[char] = (offset + i) % 10 |
| | | } |
| | | |
| | | let lictime = +key2.replace(/[A-Z]/ig, (s) => { |
| | | return keys[s] |
| | | }) |
| | | let curtime = +moment().format('YYYYMMDD') |
| | | let licday = lictime - curtime |
| | | let _mindUrl = window.location.href.split('#')[0] + 'notMind' |
| | | |
| | | if (index > -1 || window.GLOB.licenseKey === key) { |
| | | if (licday < 0 || isNaN(licday)) { |
| | | Modal.warning({ |
| | | title: '本地授权码已失效,请联系管理员。', |
| | | okText: '知道了' |
| | | }) |
| | | } else if (licday > 20) { |
| | | license = true |
| | | localStorage.removeItem(_mindUrl) |
| | | } else { |
| | | license = true |
| | | |
| | | if (localStorage.getItem(_mindUrl) !== 'false') { |
| | | Modal.confirm({ |
| | | title: `距离授权到期还剩${licday}天,请联系管理员。`, |
| | | okText: '不在提醒', |
| | | cancelText: '关闭', |
| | | onOk() { |
| | | localStorage.setItem(_mindUrl, 'false') |
| | | }, |
| | | onCancel() {}, |
| | | }) |
| | | } |
| | | } |
| | | } else { |
| | | Modal.warning({ |
| | | title: '本地授权码已失效,请联系管理员。', |
| | | okText: '知道了' |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if ((!window.GLOB.licenseKey && index > -1) || license) { |
| | | this.setState({ |
| | | auth: true |
| | | }) |
| | | } |
| | | |
| | | if (window.GLOB.licenseKey !== key && (index === -1 || index > 5)) { |
| | | if (!window.GLOB.licenseKey && (index === -1 || index > 5)) { |
| | | let _appId = window.GLOB.appId |
| | | |
| | | if (options.sysType === 'cloud') { // 云端使用系统配置appid |
| | |
| | | this.setState({ |
| | | auth: true |
| | | }) |
| | | |
| | | if (res.warning_day && res.warning_day < 20) { |
| | | Modal.warning({ |
| | | title: `距离授权到期还剩${res.warning_day}天,请联系管理员。`, |
| | | okText: '知道了' |
| | | }) |
| | | } |
| | | } else { |
| | | localStorage.removeItem(_authUrl) |
| | | this.setState({ |
| | |
| | | title: cell.label, |
| | | }) |
| | | }) |
| | | card.backElements && card.backElements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | this.checkBtn(cell) |
| | | m.children.push({ |
| | | key: cell.uuid, |
| | | title: cell.label, |
| | | }) |
| | | }) |
| | | }) |
| | | } else if (item.type === 'carousel' || item.type === 'timeline') { |
| | | item.subcards.forEach(card => { |
| | |
| | | } |
| | | |
| | | getMiniStyle = (config) => { |
| | | console.log(config) |
| | | config.miniStyle = this.transferStyle(config.style) |
| | | |
| | | let traversal = (components) => { |
| | | return components.map(item => { |
| | | if (item.style) { |
| | | item.miniStyle = this.transferStyle(item.style) |
| | | } |
| | | if (item.headerStyle) { |
| | | item.miniHeaderStyle = this.transferStyle(item.headerStyle) |
| | | } |
| | | |
| | | if (item.action && item.action.length > 0) { |
| | | item.action = item.action.map(btn => { |
| | | btn.miniStyle = this.transferStyle(btn.style) |
| | | return btn |
| | | }) |
| | | } |
| | | |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | tab.components = traversal(tab.components) |
| | | }) |
| | | } else if (item.type === 'group') { |
| | | item.components = traversal(item.components) |
| | | } else if (['card', 'carousel', 'timeline'].includes(item.type) || (item.type === 'table' && item.subtype === 'tablecard')) { |
| | | item.subcards.forEach(card => { |
| | | card.miniStyle = this.transferStyle(card.style) |
| | | card.elements = card.elements.map(cell => { |
| | | cell.miniStyle = this.transferStyle(cell.style) |
| | | return cell |
| | | }) |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | | item.elements && item.elements.forEach(cell => { |
| | | cell.miniStyle = this.transferStyle(cell.style) |
| | | }) |
| | | } else if (item.type === 'menubar') { |
| | | item.subMenus = item.subMenus.map(menu => { |
| | | menu.miniStyle = this.transferStyle(menu.style) |
| | | return menu |
| | | }) |
| | | } else if (item.type === 'table' && item.subtype === 'normaltable') { |
| | | let getCols = (cols) => { |
| | | return cols.map(col => { |
| | | if (col.type === 'colspan') { |
| | | col.subcols = getCols(col.subcols || []) |
| | | } else if (col.type === 'custom' || col.type === 'action') { |
| | | col.elements = col.elements.map(cell => { |
| | | cell.miniStyle = this.transferStyle(cell.style) |
| | | return cell |
| | | }) |
| | | } |
| | | |
| | | return col |
| | | }) |
| | | } |
| | | |
| | | item.cols = getCols(item.cols) |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | } |
| | | |
| | | config.components = traversal(config.components) |
| | | |
| | | return config |
| | | } |
| | | |
| | | transferStyle = (style = {}) => { |
| | | let _style = '' |
| | | Object.keys(style).forEach(key => { |
| | | if (['hShadow', 'vShadow', 'shadowBlur', 'shadowColor'].includes(key)) return |
| | | if (!style[key]) return |
| | | _style += `${key.replace(/[A-Z]/g, m => '-' + m.toLowerCase())}:${style[key]};` |
| | | }) |
| | | |
| | | return _style |
| | | } |
| | | |
| | | submitConfig = () => { |
| | | let config = fromJS(this.state.config).toJS() |
| | | |