Merge branch 'master' into positec
| | |
| | | |
| | | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. |
| | | |
| | | node --max-old-space-size=9000 scripts/build.js |
| | | |
| | | ### `npm run eject` |
| | | |
| | | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** |
| | |
| | | }, |
| | | "scripts": { |
| | | "dev": "set PORT=3001 && node scripts/start.js", |
| | | "build": "node --max-old-space-size=9000 scripts/build.js", |
| | | "build": "node --max-old-space-size=2048 scripts/build.js", |
| | | "test": "node scripts/test.js" |
| | | }, |
| | | "eslintConfig": { |
| | |
| | | import axios from 'axios' |
| | | import qs from 'qs' |
| | | import { notification } from 'antd' |
| | | import { notification, Modal } from 'antd' |
| | | import md5 from 'md5' |
| | | import CryptoJS from 'crypto-js' |
| | | import jsSHA from 'jssha' |
| | |
| | | |
| | | window.GLOB.IndexDB = null |
| | | window.GLOB.OuterToken = {} |
| | | window.GLOB.$error = false |
| | | |
| | | let service = window.GLOB.service ? '-' + window.GLOB.service.replace('/', '') : '' |
| | | let db = `mkdb${service}` |
| | |
| | | axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8' |
| | | axios.defaults.withCredentials = false |
| | | |
| | | // axios.interceptors.request.use((config) => { |
| | | // return config |
| | | // }, (error) => { |
| | | // return Promise.reject(error) |
| | | // }) |
| | | axios.interceptors.response.use((response) => { |
| | | if (response.data.ErrCode === 'LoginError') { |
| | | if (window.GLOB.developing) { |
| | | sessionStorage.setItem('devError', 'true') |
| | | response.data.ErrCode = 'E' |
| | | return Promise.resolve(response.data) |
| | | } else if (response.config.url.indexOf('https://sso.mk9h.cn/webapi/dostars') > -1) { |
| | | return Promise.reject(response.data) |
| | | } else if (response.config.url.indexOf('https://epc.mk9h.cn/webapi/dostars') > -1) { |
| | | return Promise.reject(response.data) |
| | | } |
| | | |
| | | const setCurrentUrl = (res) => { |
| | | if (!!(window.history && window.history.pushState)) { |
| | | if (!window.GLOB.$error) { |
| | | window.GLOB.$error = true |
| | | |
| | | Modal.destroyAll() |
| | | Modal.error({ |
| | | title: response.data.message, |
| | | onOk: () => { |
| | | window.GLOB.$error = false |
| | | sessionStorage.clear() |
| | | sessionStorage.setItem('loginError', JSON.stringify({url: res.config ? res.config.url : '', request: res.config ? res.config.data : '', response: JSON.stringify(res.data)})) |
| | | if (!!(window.history && window.history.pushState)) { |
| | | window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') |
| | | window.location.reload() |
| | | } |
| | | } |
| | | |
| | | axios.interceptors.response.use((response) => { |
| | | if (response.data.ErrCode === 'LoginError') { |
| | | if (window.debugger === true) { |
| | | response.data.ErrCode = 'E' |
| | | return Promise.resolve(response.data) |
| | | } else if (window.GLOB.developing) { |
| | | sessionStorage.setItem('devError', 'true') |
| | | response.data.ErrCode = 'E' |
| | | return Promise.resolve(response.data) |
| | | } else if (!sessionStorage.getItem('loginError')) { |
| | | setCurrentUrl(response) |
| | | }) |
| | | } |
| | | |
| | | return Promise.reject(response.data) |
| | | } else { |
| | | return Promise.resolve(response.data) |
| | | } |
| | | }, (error) => { |
| | | let response = error.response |
| | | let response = error.response || '' |
| | | |
| | | if (response) { |
| | | if (!response.data || !response.data.errors) { // 过滤旷视报错信息 |
| | | if (response && (!response.data || !response.data.errors)) { // 过滤旷视报错信息 |
| | | notification.error({ |
| | | className: 'notification-custom-error', |
| | | bottom: 0, |
| | |
| | | duration: 15 |
| | | }) |
| | | } |
| | | |
| | | return Promise.reject(response) |
| | | } else { |
| | | return Promise.reject() |
| | | } |
| | | }) |
| | | |
| | | class Api { |
| | |
| | | } |
| | | } |
| | | } |
| | | .ant-modal-wrap.mk-scroll-modal { |
| | | .ant-modal { |
| | | top: 50px; |
| | | } |
| | | .ant-modal-body { |
| | | min-height: 150px; |
| | | max-height: calc(100vh - 170px); |
| | | overflow-y: auto; |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar { |
| | | width: 7px; |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar-thumb { |
| | | border-radius: 5px; |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); |
| | | background: rgba(0, 0, 0, 0.13); |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar-track { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); |
| | | border-radius: 3px; |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | } |
| | | |
| | | .ant-modal { |
| | | .ant-radio-group { |
| | |
| | | }) |
| | | message.warning(res.message) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') { |
| | | let param = { |
| | | func: 's_visitor_login', |
| | | timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), |
| | | SessionUid: 'bh0bapabtd45epsgra79segbch6c1ibk', |
| | | TypeCharOne: 'pc', |
| | | appkey: '202004041613277377A6A2456D34A4948AE84' |
| | | } |
| | | |
| | | param.LText = md5(window.btoa('bh0bapabtd45epsgra79segbch6c1ibk' + param.timestamp)) |
| | | param.secretkey = md5(param.LText + 'mingke' + param.timestamp) |
| | | |
| | | let params = { |
| | | url: 'https://sso.mk9h.cn/webapi/dologon', |
| | | method: 'post', |
| | | data: JSON.stringify(param) |
| | | } |
| | | |
| | | Api.directRequest(params) |
| | | |
| | | return |
| | | } |
| | | |
| | | clearTimeout(this.LoginTimer) |
| | | this.setState({ |
| | | verdisabled: false, |
| | |
| | | {/* 编辑按钮:复制、编辑 */} |
| | | <Modal |
| | | title="编辑元素" |
| | | wrapClassName="mk-scroll-modal" |
| | | visible={visible} |
| | | width={850} |
| | | maskClosable={false} |
| | |
| | | {/* 编辑按钮:复制、编辑 */} |
| | | <Modal |
| | | title="按钮·编辑" |
| | | wrapClassName="mk-scroll-modal" |
| | | visible={actvisible} |
| | | width={920} |
| | | maskClosable={false} |
| | |
| | | type: 'radio', |
| | | field: 'click', |
| | | label: '点击事件', |
| | | initval: card.click || '', |
| | | initval: card.click || 'switch', |
| | | tooltip: '点击节点时触发的事件。', |
| | | required: false, |
| | | options: [ |
| | | {value: '', label: '数据切换'}, |
| | | {value: 'switch', label: '数据切换'}, |
| | | {value: 'menu', label: '菜单'}, |
| | | {value: 'menus', label: '菜单组'} |
| | | ], |
| | |
| | | width: card.width || 24, |
| | | height: 400, |
| | | subtype: card.subtype, |
| | | click: 'switch', |
| | | name: card.name |
| | | } |
| | | |
| | |
| | | required: false, |
| | | options: [ |
| | | {value: '', label: '无'}, |
| | | {value: 'switch', label: '数据切换'}, |
| | | {value: 'menu', label: '菜单'}, |
| | | {value: 'menus', label: '菜单组'} |
| | | ], |
| | |
| | | {field: 'menus', values: ['menus']}, |
| | | {field: 'menuType', values: ['menus']}, |
| | | {field: 'open', values: ['menu', 'menus']}, |
| | | {field: 'joint', values: ['menu', 'menus']}, |
| | | ] |
| | | }, |
| | | { |
| | |
| | | {value: 'self', label: '当前窗口'}, |
| | | ], |
| | | forbid: appType !== 'pc' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'joint', |
| | | label: '参数拼接', |
| | | initval: card.joint || 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '是'}, |
| | | {value: 'false', label: '否'}, |
| | | ], |
| | | }, |
| | | { |
| | | type: 'table', |
| | |
| | | <Modal |
| | | wrapClassName="mk-pop-modal" |
| | | visible={visible} |
| | | width={850} |
| | | width={900} |
| | | maskClosable={false} |
| | | onOk={this.onSubmit} |
| | | onCancel={() => { this.setState({ visible: false }) }} |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { Popover } from 'antd' |
| | | import { ToolOutlined, DeleteOutlined, FontColorsOutlined } from '@ant-design/icons' |
| | | import { Graph, Shape } from '@antv/x6' |
| | | import { Graph } from '@antv/x6' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | max: 2 |
| | | }, |
| | | autoResize: true, |
| | | interacting: false, |
| | | background: { |
| | | color: card.plot.backgroundColor || 'transparent' |
| | | }, |
| | |
| | | allowBlank: false, |
| | | snap: { |
| | | radius: 20 |
| | | }, |
| | | createEdge() { |
| | | return new Shape.Edge({ |
| | | attrs: { |
| | | line: { |
| | | stroke: '#000000', |
| | | strokeWidth: 1, |
| | | targetMarker: { |
| | | name: 'block', |
| | | width: 12, |
| | | height: 8 |
| | | } |
| | | } |
| | | }, |
| | | zIndex: 0 |
| | | }) |
| | | }, |
| | | validateConnection({ targetMagnet }) { |
| | | return !!targetMagnet |
| | | } |
| | | }, |
| | | highlighting: { |
| | | magnetAdsorbed: { |
| | | name: 'stroke', |
| | | args: { |
| | | attrs: { |
| | | fill: '#5F95FF', |
| | | stroke: '#5F95FF' |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }) |
| | |
| | | max: 2 |
| | | }, |
| | | autoResize: true, |
| | | interacting: false, |
| | | background: { color: '#ffffff' }, |
| | | mousewheel: { |
| | | enabled: true, |
| | |
| | | allowBlank: false, |
| | | snap: { |
| | | radius: 20 |
| | | }, |
| | | createEdge() { |
| | | return new Shape.Edge({ |
| | | attrs: { |
| | | line: { |
| | | stroke: '#000000', |
| | | strokeWidth: 1, |
| | | targetMarker: { |
| | | name: 'block', |
| | | width: 12, |
| | | height: 8 |
| | | } |
| | | } |
| | | }, |
| | | zIndex: 2 |
| | | }) |
| | | }, |
| | | validateConnection({ targetMagnet }) { |
| | | return !!targetMagnet |
| | | } |
| | | }, |
| | | highlighting: { |
| | | magnetAdsorbed: { |
| | | name: 'stroke', |
| | | args: { |
| | | attrs: { |
| | | fill: '#5F95FF', |
| | | stroke: '#5F95FF' |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | translating: { |
| | | restrict(cellView) { |
| | | const cell = cellView.cell |
| | | const parentId = cell.prop('parent') |
| | | |
| | | if (parentId) { |
| | | const parentNode = graph.getCellById(parentId) |
| | | if (parentNode) { |
| | | return parentNode.getBBox().moveAndExpand({ |
| | | x: 0, |
| | | y: 36, |
| | | width: 0, |
| | | height: -36, |
| | | }) |
| | | } |
| | | } |
| | | return cell.getBBox() |
| | | } |
| | | } |
| | | }) |
| | |
| | | </div> |
| | | <Modal |
| | | title="编辑" |
| | | wrapClassName="mk-scroll-modal" |
| | | visible={this.state.visible} |
| | | width={950} |
| | | maskClosable={false} |
| | |
| | | </div> |
| | | <Modal |
| | | title="编辑" |
| | | wrapClassName="mk-scroll-modal" |
| | | visible={this.state.visible} |
| | | width={950} |
| | | maskClosable={false} |
| | |
| | | </div> |
| | | <Modal |
| | | title="编辑" |
| | | wrapClassName="mk-scroll-modal" |
| | | visible={this.state.visible} |
| | | width={950} |
| | | maskClosable={false} |
| | |
| | | {/* 编辑搜索条件 */} |
| | | <Modal |
| | | title="搜索条件-编辑" |
| | | wrapClassName="mk-scroll-modal" |
| | | visible={visible} |
| | | width={850} |
| | | maskClosable={false} |
| | |
| | | {/* 编辑按钮:复制、编辑 */} |
| | | <Modal |
| | | title="按钮·编辑" |
| | | wrapClassName="mk-scroll-modal" |
| | | visible={visible} |
| | | width={920} |
| | | maskClosable={false} |
| | |
| | | <div style={{display: 'inline-block'}}> |
| | | <Modal |
| | | title="显示列编辑" |
| | | wrapClassName="mk-scroll-modal" |
| | | visible={visible} |
| | | width={850} |
| | | maskClosable={false} |
| | |
| | | <div style={{display: 'inline-block'}}> |
| | | <Modal |
| | | title="显示列编辑" |
| | | wrapClassName="mk-scroll-modal" |
| | | visible={visible} |
| | | width={900} |
| | | maskClosable={false} |
| | |
| | | <div style={{display: 'inline-block'}}> |
| | | <Modal |
| | | title="显示列编辑" |
| | | wrapClassName="mk-scroll-modal" |
| | | visible={visible} |
| | | width={850} |
| | | maskClosable={false} |
| | |
| | | </DndProvider> |
| | | <Modal |
| | | title={card && card.$copy ? '复制' : '编辑'} |
| | | wrapClassName="mk-scroll-modal" |
| | | visible={this.state.visible} |
| | | width={950} |
| | | maskClosable={false} |
| | |
| | | const _this = this |
| | | |
| | | if (!config.enabled) { |
| | | let tb = config.components[0] |
| | | if (config.components.length === 1 && tb.setting.interType === 'system' && !tb.setting.dataresource) { |
| | | confirm({ |
| | | title: '当前页面将清空,确定切换为自定义页面吗?', |
| | | content: '', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.execUpdate(resolve, true) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | |
| | | return |
| | | } |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未启用菜单不可升级!', |
| | |
| | | }) |
| | | } |
| | | |
| | | execUpdate = (_resolve) => { |
| | | execUpdate = (_resolve, clear) => { |
| | | let _config = fromJS(this.props.config).toJS() |
| | | _config.permission = 'true' |
| | | _config.Template = 'CustomPage' |
| | |
| | | delete _config.autoMatic |
| | | |
| | | let useMSearch = false |
| | | |
| | | if (clear) { |
| | | _config.components = [] |
| | | } else { |
| | | _config.components.forEach((item, i) => { |
| | | if (item.type === 'tabs') { |
| | | item.name = '标签组' + i |
| | |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (useMSearch) { |
| | | let cell = { |
| | |
| | | </DndProvider> |
| | | <Modal |
| | | title={card && card.$copy ? '复制' : '编辑'} |
| | | wrapClassName="mk-scroll-modal" |
| | | visible={this.state.visible} |
| | | width={950} |
| | | maskClosable={false} |
| | |
| | | data: PropTypes.object, |
| | | } |
| | | |
| | | state = { |
| | | card: null, // 卡片信息,包括正反面 |
| | | } |
| | | |
| | | /** |
| | | * @description 搜索条件初始化 |
| | | */ |
| | | UNSAFE_componentWillMount () { |
| | | |
| | | } |
| | | state = {} |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) || !is(fromJS(this.props), fromJS(nextProps)) |
| | | return !is(fromJS(this.props.data), fromJS(nextProps.data)) |
| | | } |
| | | |
| | | /** |
| | |
| | | render() { |
| | | const { card, data, cards, children } = this.props |
| | | let style = {...card.style} |
| | | |
| | | let bg = null |
| | | |
| | | if (card.setting.bgField) { |
| | |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) |
| | | return !is(fromJS(this.props.data), fromJS(nextProps.data)) |
| | | } |
| | | |
| | | /** |
| | |
| | | handleClick = (data = null) => { |
| | | const { plot, config } = this.state |
| | | |
| | | if (plot.click && !data) return |
| | | |
| | | if (plot.click === 'menus') { |
| | | if (!data) return |
| | | |
| | | let menu = null |
| | | |
| | | if (plot.menus && plot.menus.length > 0) { |
| | |
| | | |
| | | MKEmitter.emit('modifyTabs', newtab, true) |
| | | } else if (plot.click === 'menu') { |
| | | if (!data) return |
| | | |
| | | let menuId = plot.menu.slice(-1)[0] |
| | | let newtab = window.GLOB.mkThdMenus.filter(m => m.MenuID === menuId)[0] |
| | | |
| | |
| | | } |
| | | } |
| | | }, |
| | | // { |
| | | // inherit: 'rect', |
| | | // width: 66, |
| | | // height: 36, |
| | | // attrs: { |
| | | // body: { |
| | | // strokeWidth: 0, |
| | | // fill: 'transparent' |
| | | // }, |
| | | // text: { |
| | | // fontSize: 12, |
| | | // fill: '#262626' |
| | | // } |
| | | // } |
| | | // }, |
| | | true |
| | | ) |
| | | |
| | | const styles = { |
| | | blue: '#1890ff', |
| | | red: '#f5222d', |
| | | orange_red: '#fa541c', |
| | | orange: '#fa8c16', |
| | | orange_yellow: '#faad14', |
| | | yellow: '#fadb14', |
| | | yellow_green: '#a0d911', |
| | | green: '#52c41a', |
| | | cyan: '#13c2c2', |
| | | blue_purple: '#2f54eb', |
| | | purple: '#722ed1', |
| | | magenta: '#eb2f96', |
| | | grass_green: '#aeb303', |
| | | deep_red: '#c32539', |
| | | deep_blue: '#1d3661', |
| | | blue1: '#e6f7ff', |
| | | red1: '#fff1f0', |
| | | orange_red1: '#fff2e8', |
| | | orange1: '#fff7e6', |
| | | orange_yellow1: '#fffbe6', |
| | | yellow1: '#feffe6', |
| | | yellow_green1: '#fcffe6', |
| | | green1: '#f6ffed', |
| | | cyan1: '#e6fffb', |
| | | blue_purple1: '#f0f5ff', |
| | | purple1: '#f9f0ff', |
| | | magenta1: '#fff0f6', |
| | | grass_green1: '#f2efda', |
| | | deep_red1: '#fff0f0', |
| | | deep_blue1: '#eff1f4' |
| | | } |
| | | |
| | | let sysColor = '#1890ff' |
| | | let lightColor = '#e6f7ff' |
| | | if (window.GLOB.style) { |
| | | let type = window.GLOB.style.replace(/bg_black_style_|bg_white_style_/, '') |
| | | sysColor = styles[type] || '#1890ff' |
| | | lightColor = styles[type + '1'] || '#e6f7ff' |
| | | } |
| | | |
| | | class antvX6Chart extends Component { |
| | | static propTpyes = { |
| | |
| | | max: 2 |
| | | }, |
| | | autoResize: true, |
| | | interacting: false, |
| | | panning: true, |
| | | background: { |
| | | color: config.plot.backgroundColor || 'transparent' |
| | |
| | | allowBlank: false, |
| | | snap: { |
| | | radius: 20 |
| | | }, |
| | | createEdge() { |
| | | return new Shape.Edge({ |
| | | attrs: { |
| | | line: { |
| | | stroke: '#000000', |
| | | strokeWidth: 1, |
| | | targetMarker: { |
| | | name: 'block', |
| | | width: 12, |
| | | height: 8 |
| | | } |
| | | } |
| | | }, |
| | | zIndex: 0 |
| | | }) |
| | | }, |
| | | validateConnection({ targetMagnet }) { |
| | | return !!targetMagnet |
| | | } |
| | | }, |
| | | highlighting: { |
| | | magnetAdsorbed: { |
| | | name: 'stroke', |
| | | args: { |
| | | attrs: { |
| | | fill: '#5F95FF', |
| | | stroke: '#5F95FF' |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }) |
| | |
| | | graph.resetCells(cells) |
| | | graph.positionContent('center') |
| | | } |
| | | |
| | | if (config.plot.click) { |
| | | graph.on('cell:click', ({ node }) => { |
| | | this.checkNode(graph, node) |
| | | }) |
| | | |
| | | graph.on('blank:click', () => { |
| | | this.checkNode(graph) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | laneSrender = () => { |
| | |
| | | min: 0.5, |
| | | max: 2 |
| | | }, |
| | | interacting: false, |
| | | autoResize: true, |
| | | panning: true, |
| | | background: { color: '#ffffff' }, |
| | |
| | | allowBlank: false, |
| | | snap: { |
| | | radius: 20 |
| | | }, |
| | | createEdge() { |
| | | return new Shape.Edge({ |
| | | attrs: { |
| | | line: { |
| | | stroke: '#000000', |
| | | strokeWidth: 1, |
| | | targetMarker: { |
| | | name: 'block', |
| | | width: 12, |
| | | height: 8 |
| | | } |
| | | } |
| | | }, |
| | | zIndex: 2 |
| | | }) |
| | | }, |
| | | validateConnection({ targetMagnet }) { |
| | | return !!targetMagnet |
| | | } |
| | | }, |
| | | highlighting: { |
| | | magnetAdsorbed: { |
| | | name: 'stroke', |
| | | args: { |
| | | attrs: { |
| | | fill: '#5F95FF', |
| | | stroke: '#5F95FF' |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | translating: { |
| | | restrict(cellView) { |
| | | const cell = cellView.cell |
| | | const parentId = cell.prop('parent') |
| | | |
| | | if (parentId) { |
| | | const parentNode = graph.getCellById(parentId) |
| | | if (parentNode) { |
| | | return parentNode.getBBox().moveAndExpand({ |
| | | x: 0, |
| | | y: 36, |
| | | width: 0, |
| | | height: -36, |
| | | }) |
| | | } |
| | | } |
| | | return cell.getBBox() |
| | | } |
| | | } |
| | | }) |
| | |
| | | }) |
| | | graph.resetCells(cells) |
| | | graph.positionContent('top') |
| | | } |
| | | |
| | | if (config.plot.click) { |
| | | graph.on('cell:click', ({ node }) => { |
| | | this.checkNode(graph, node) |
| | | }) |
| | | |
| | | graph.on('blank:click', () => { |
| | | this.checkNode(graph) |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | showPorts(ports, false) |
| | | }) |
| | | |
| | | graph.on('node:click', ({ e, x, y, node, view }) => { |
| | | graph.on('node:click', ({ node }) => { |
| | | this.selectNode = node |
| | | |
| | | this.setState({node: node.store.data}) |
| | | }) |
| | | graph.on('edge:click', ({ e, x, y, edge, view }) => { |
| | | graph.on('edge:click', ({ edge }) => { |
| | | this.selectNode = edge |
| | | |
| | | this.setState({node: edge.store.data}) |
| | | |
| | | graph.clearTransformWidgets() |
| | | }) |
| | | graph.on('blank:click', ({ e, x, y }) => { |
| | | graph.on('blank:click', () => { |
| | | this.selectNode = null |
| | | |
| | | this.setState({node: null}) |
| | |
| | | }) |
| | | |
| | | const p3 = graph.createNode({ |
| | | shape: 'mk-text', |
| | | label: '文本' |
| | | shape: 'mk-text' |
| | | }) |
| | | |
| | | stencil.load([p1, p2, p3], 'group2') |
| | |
| | | }) |
| | | |
| | | graph |
| | | .use(new Transform({ |
| | | resizing: true, |
| | | rotating: true |
| | | })) |
| | | .use(new Selection()) |
| | | .use(new Snapline()) |
| | | .use(new Snapline({ |
| | | enabled: true, |
| | | filter: (Graph) => Graph.prop('shape') !== 'lane' |
| | | })) |
| | | .use(new Keyboard()) |
| | | .use(new Clipboard()) |
| | | .use(new History()) |
| | |
| | | graph.bindKey(['meta+c', 'ctrl+c'], () => { |
| | | const cells = graph.getSelectedCells() |
| | | if (cells.length) { |
| | | if (cells[0].prop('shape') !== 'lane' && cells[0].prop('shape') !== 'edge') { |
| | | graph.copy(cells) |
| | | } |
| | | } |
| | | return false |
| | | }) |
| | | graph.bindKey(['meta+x', 'ctrl+x'], () => { |
| | | const cells = graph.getSelectedCells() |
| | | if (cells.length) { |
| | | if (cells[0].prop('shape') !== 'lane' && cells[0].prop('shape') !== 'edge') { |
| | | graph.cut(cells) |
| | | } |
| | | } |
| | | return false |
| | | }) |
| | |
| | | graph.bindKey(['backspace', 'delete'], () => { |
| | | const cells = graph.getSelectedCells() |
| | | if (cells.length) { |
| | | graph.removeCells(cells) |
| | | this.selectNode = null |
| | | this.setState({node: null}) |
| | | |
| | | if (cells[0].prop('shape') === 'lane') { |
| | | graph.startBatch('delete-lane') |
| | | |
| | | graph.removeCells(cells) |
| | | this.deleteLane(cells[0], graph) |
| | | |
| | | graph.stopBatch('delete-lane') |
| | | } else { |
| | | graph.removeCells(cells) |
| | | } |
| | | } |
| | | }) |
| | | |
| | |
| | | showPorts(ports, false) |
| | | }) |
| | | |
| | | graph.on('node:added', ({ cell, index, options }) => { |
| | | graph.on('node:added', ({ cell }) => { |
| | | if (cell.prop('shape') === 'lane') { |
| | | if (cell.prop('zIndex') === 0) return |
| | | |
| | | graph.startBatch('add-lane') |
| | | |
| | | this.addLane(cell, graph) |
| | |
| | | if (num <= 1) { |
| | | message.warning('请添加泳道!') |
| | | graph.removeCells([cell]) |
| | | } else { |
| | | } else if (!cell.prop('parent')) { |
| | | this.addNode(cell, graph) |
| | | } |
| | | } |
| | | }) |
| | | graph.on('node:click', ({ e, x, y, node, view }) => { |
| | | graph.on('node:click', ({ node }) => { |
| | | this.selectNode = node |
| | | this.setState({node: node.store.data}) |
| | | |
| | | if (node.prop('shape') === 'lane') { |
| | | graph.clearTransformWidgets() |
| | | } |
| | | }) |
| | | graph.on('edge:click', ({ e, x, y, edge, view }) => { |
| | | graph.on('edge:click', ({ edge }) => { |
| | | this.selectNode = edge |
| | | this.setState({node: edge.store.data}) |
| | | |
| | | graph.clearTransformWidgets() |
| | | }) |
| | | graph.on('blank:click', ({ e, x, y }) => { |
| | | graph.on('blank:click', () => { |
| | | this.selectNode = null |
| | | |
| | | this.setState({node: null}) |
| | |
| | | }) |
| | | |
| | | const p3 = graph.createNode({ |
| | | shape: 'mk-text', |
| | | label: '文本' |
| | | shape: 'mk-text' |
| | | }) |
| | | |
| | | stencil.load([p1, p2, p3], 'group2') |
| | |
| | | // }, {padding: 20}) |
| | | } |
| | | |
| | | deleteLane = (cell, graph) => { |
| | | let id = cell.id |
| | | |
| | | let nodes = graph.getNodes() |
| | | let cells = [] |
| | | |
| | | nodes.forEach(item => { |
| | | if (item.prop('shape') === 'lane') return |
| | | |
| | | if (item.prop('parent') === id) { |
| | | cells.push(item) |
| | | } |
| | | }) |
| | | |
| | | graph.removeCells(cells) |
| | | |
| | | this.resetlane(cell.id, cell.prop('position/x'), -cell.prop('size/width')) |
| | | } |
| | | |
| | | addLane = (cell, graph) => { |
| | | const { config } = this.state |
| | | |
| | |
| | | } |
| | | |
| | | let height = 400 |
| | | |
| | | if (typeof(config.plot.height) === 'number' || /px/.test(config.plot.height)) { |
| | | height = parseInt(config.plot.height) |
| | | } |
| | |
| | | const { node } = this.state |
| | | |
| | | if (node.shape === 'edge') { |
| | | let labels = this.selectNode.prop('labels') |
| | | if (!labels || labels.length === 0) { |
| | | labels = [{ |
| | | attrs: {label: { text: '' }} |
| | | }] |
| | | } |
| | | |
| | | if (key === 'title') { |
| | | this.selectNode.setLabels(value) |
| | | labels = JSON.parse(JSON.stringify(labels)) |
| | | labels[0].attrs.label.text = value |
| | | this.selectNode.setLabels(labels) |
| | | } else if (key === 'stroke') { |
| | | this.selectNode.attr('line/stroke', value) |
| | | } else if (key === 'strokeWidth') { |
| | | this.selectNode.attr('line/strokeWidth', value) |
| | | } else if (key === 'fontSize') { |
| | | labels = JSON.parse(JSON.stringify(labels)) |
| | | labels[0].attrs.label.fontSize = value |
| | | this.selectNode.setLabels(labels) |
| | | } else if (key === 'fontFill') { |
| | | labels = JSON.parse(JSON.stringify(labels)) |
| | | labels[0].attrs.label.fill = value |
| | | this.selectNode.setLabels(labels) |
| | | } else if (key === 'lineType') { |
| | | if (value === 'dash') { |
| | | this.selectNode.attr('line/strokeDasharray', 5) |
| | |
| | | } |
| | | } |
| | | |
| | | checkNode = (graph, node) => { |
| | | const { plot, config } = this.state |
| | | |
| | | let nodes = graph.getNodes() |
| | | |
| | | nodes.forEach(item => { |
| | | if (item.prop('shape') === 'lane') return |
| | | |
| | | if (item.prop('oristyle')) { |
| | | let style = item.prop('oristyle') |
| | | |
| | | item.prop('attrs/body/fill', style.fill) |
| | | item.prop('attrs/body/stroke', style.stroke) |
| | | item.prop('attrs/text/fill', style.text) |
| | | } |
| | | }) |
| | | |
| | | if (!node || ['lane', 'mk-text', 'edge'].includes(node.prop('shape'))) { |
| | | MKEmitter.emit('resetSelectLine', config.uuid, '', '') |
| | | return |
| | | } |
| | | |
| | | if (!node.prop('oristyle')) { |
| | | node.prop('oristyle', { |
| | | fill: node.prop('attrs/body/fill'), |
| | | stroke: node.prop('attrs/body/stroke'), |
| | | text: node.prop('attrs/text/fill') |
| | | }) |
| | | } |
| | | |
| | | node.prop('attrs/body/fill', lightColor) |
| | | node.prop('attrs/body/stroke', sysColor) |
| | | node.prop('attrs/text/fill', sysColor) |
| | | |
| | | let sign = node.prop('mksign') || '' |
| | | |
| | | if (plot.click === 'menus') { |
| | | let menu = null |
| | | |
| | | if (plot.menus && plot.menus.length > 0) { |
| | | plot.menus.forEach(m => { |
| | | if (sign !== m.sign) return |
| | | menu = m |
| | | }) |
| | | } |
| | | if (!menu || !menu.MenuID) return |
| | | |
| | | let newtab = { |
| | | MenuID: menu.MenuID, |
| | | MenuName: menu.MenuName, |
| | | MenuNo: menu.MenuNo || '', |
| | | type: menu.tabType, |
| | | param: {$BID: sign} |
| | | } |
| | | |
| | | MKEmitter.emit('modifyTabs', newtab, true) |
| | | } else if (plot.click === 'menu') { |
| | | let menuId = plot.menu.slice(-1)[0] |
| | | let newtab = window.GLOB.mkThdMenus.filter(m => m.MenuID === menuId)[0] |
| | | |
| | | if (!newtab && plot.MenuID) { |
| | | newtab = { |
| | | MenuID: plot.MenuID, |
| | | MenuName: plot.MenuName, |
| | | MenuNo: plot.MenuNo, |
| | | type: plot.tabType |
| | | } |
| | | } else if (!newtab) { |
| | | return |
| | | } |
| | | |
| | | MKEmitter.emit('modifyTabs', {...newtab, param: {$BID: sign}}, true) |
| | | } else { |
| | | MKEmitter.emit('resetSelectLine', config.uuid, sign, {}) |
| | | } |
| | | } |
| | | |
| | | resetlane = (id, x, offset) => { |
| | | let nodes = this.mkGraph.getNodes() |
| | | |
| | |
| | | </div> : null |
| | | } |
| | | <NormalHeader config={config} /> |
| | | <div className="canvas" style={{width: '100%', minHeight: config.plot.height, height: config.plot.height}} id={config.uuid + 'canvas'}> |
| | | <div className={'canvas only-show' + (config.plot.click ? ' switchable' : '')} style={{width: '100%', minHeight: config.plot.height, height: config.plot.height}} id={config.uuid + 'canvas'}> |
| | | <div id={config.uuid + 'container'} className="mk-container"></div> |
| | | </div> |
| | | </div> |
| | |
| | | opacity: 0; |
| | | } |
| | | } |
| | | .only-show { |
| | | .x6-port { |
| | | display: none; |
| | | } |
| | | .x6-cell.x6-edge { |
| | | cursor: default; |
| | | path { |
| | | cursor: default; |
| | | } |
| | | } |
| | | } |
| | | .only-show.switchable { |
| | | .x6-cell.x6-node:not([data-shape="lane"]):not([data-shape="mk-text"]) { |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | |
| | | .chart-header { |
| | | position: relative; |
| | |
| | | |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | |
| | | class NodeUpdate extends Component { |
| | | static propTpyes = { |
| | | node: PropTypes.object, |
| | |
| | | lineType = 'dash' |
| | | } |
| | | |
| | | let font = node.labels && node.labels[0] ? node.labels[0].attrs.label : {} |
| | | |
| | | return [ |
| | | { |
| | | type: 'title', |
| | |
| | | type: 'text', |
| | | field: 'title', |
| | | label: '标签', |
| | | initval: title |
| | | initval: font.text || '' |
| | | }, |
| | | { |
| | | type: 'title', |
| | |
| | | {value: 'solid', text: '实线'}, |
| | | {value: 'dash', text: '虚线'} |
| | | ] |
| | | }, |
| | | { |
| | | type: 'title', |
| | | label: '标签样式' |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'fontSize', |
| | | label: '字号', |
| | | initval: font.fontSize || 14 |
| | | }, |
| | | { |
| | | type: 'color', |
| | | field: 'fontFill', |
| | | label: '颜色', |
| | | initval: font.fill || '#000000' |
| | | } |
| | | ] |
| | | } else if (node.shape === 'lane') { |
| | |
| | | label: '内容' |
| | | }, |
| | | { |
| | | type: 'text', |
| | | type: 'textarea', |
| | | field: 'title', |
| | | label: '标签', |
| | | initval: title |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'textarea') { |
| | | fields.push( |
| | | <Col span={24} key={index} style={{padding: '0 12px'}}> |
| | | <TextArea defaultValue={item.initval} rows={3} onChange={(e) => this.change(e.target.value, item.field)} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'number') { |
| | | fields.push( |
| | | <Col span={24} key={index}> |
| | |
| | | padding-bottom: 2px; |
| | | font-size: 13px; |
| | | } |
| | | textarea.ant-input { |
| | | padding: 0px 4px; |
| | | border-radius: 0px; |
| | | } |
| | | .ant-form-item { |
| | | display: flex; |
| | | margin-bottom: 10px; |
| | |
| | | } else { |
| | | this.execError(res) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | |
| | | this.execError({}) |
| | | }) |
| | | } else if (submit.intertype === 'inner' && submit.innerFunc) { // 自定义存储过程 |
| | |
| | | } else { |
| | | this.execError(res) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | |
| | | this.execError({}) |
| | | }) |
| | | } |
| | |
| | | } else { |
| | | this.execError(res) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.execError({}) |
| | | }) |
| | | } else { |
| | |
| | | } else { |
| | | this.execError(res) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.execError({}) |
| | | }) |
| | | } |
| | |
| | | } else { |
| | | this.execError(res) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.execError({}) |
| | | }) |
| | | } else if (btn.intertype === 'outer') { // 外部接口 |
| | |
| | | this.execError(res) |
| | | resolve(false) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.execError({}) |
| | | }) |
| | | } else { |
| | |
| | | |
| | | return Api.genericInterface(res) |
| | | }).then(response => { |
| | | if (!response) return |
| | | if (!response || response.ErrCode === 'LoginError') return |
| | | // 回调请求 |
| | | if (ver_token && response.ErrMesg === 'token_error') { |
| | | this.execError(response) |
| | |
| | | } |
| | | } |
| | | }).then(res => { |
| | | if (!res) return |
| | | if (!res || res.ErrCode === 'LoginError') return |
| | | |
| | | if (res.status) { |
| | | this.execSuccess(res) |
| | |
| | | } else { |
| | | this.execError(result) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.execError({}) |
| | | }) |
| | | } else if (btn.intertype === 'inner') { // 使用内部函数 |
| | |
| | | } else { |
| | | this.execError(result) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.execError({}) |
| | | }) |
| | | } else if (btn.intertype === 'outer' && !btn.innerFunc) { // 使用外部函数 |
| | |
| | | } else { |
| | | this.execError(result) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.execError({}) |
| | | }) |
| | | } else if (btn.intertype === 'outer' && btn.innerFunc) { |
| | |
| | | } else { |
| | | this.execError(res) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.execError({}) |
| | | }) |
| | | } else { |
| | |
| | | } else { |
| | | this.execError(result) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.execError({}) |
| | | }) |
| | | } else { |
| | | this.execError(res) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.execError({}) |
| | | }) |
| | | } |
| | |
| | | } else { |
| | | this.execError(result) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.execError({}) |
| | | }) |
| | | } |
| | |
| | | } else { |
| | | this.execError(res) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.updateStatus('over') |
| | | }) |
| | | } |
| | |
| | | import qs from 'qs' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Button, Modal, notification, message, Drawer, Switch, Checkbox, Progress } from 'antd' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | | import Utils, { getSysDefaultSql } from '@/utils/utils.js' |
| | |
| | | this.execError(res) |
| | | } |
| | | _resolve() |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.updateStatus() |
| | | _resolve() |
| | | }) |
| | |
| | | this.triggerNote(res) // 消息 |
| | | } |
| | | resolve(res) |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.updateStatus() |
| | | _resolve() |
| | | }) |
| | |
| | | _resolve() |
| | | }) |
| | | } else { // 超出20个请求时循环执行 |
| | | if (btn.progress === 'progressbar' && btn.$toolbtn && params.length > 1) { |
| | | if (btn.progress === 'progressbar' && params.length > 1) { |
| | | this.setState({ |
| | | loadingTotal: params.length |
| | | }) |
| | |
| | | _params = this.getInnerParam(data, formdata, btn.callbackType === 'script') |
| | | } |
| | | |
| | | if (_params.length > 1 && btn.progress === 'progressbar' && btn.$toolbtn) { |
| | | if (_params.length > 1 && btn.progress === 'progressbar') { |
| | | this.setState({ |
| | | loadingTotal: _params.length |
| | | }) |
| | |
| | | params = this.getInnerParam(data, formdata, btn.callbackType === 'script') |
| | | } |
| | | |
| | | if (params.length > 1 && btn.progress === 'progressbar' && btn.$toolbtn) { |
| | | if (params.length > 1 && btn.progress === 'progressbar') { |
| | | this.setState({ |
| | | loadingTotal: params.length |
| | | }) |
| | |
| | | this.execError(res) |
| | | _resolve() |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.updateStatus() |
| | | _resolve() |
| | | }) |
| | |
| | | this.execError(res) |
| | | _resolve() |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.updateStatus() |
| | | _resolve() |
| | | }) |
| | |
| | | this.execError(res) |
| | | _resolve() |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.updateStatus() |
| | | _resolve() |
| | | }) |
| | |
| | | this.execError(res) |
| | | _resolve() |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.updateStatus() |
| | | _resolve() |
| | | }) |
| | |
| | | this.execError(res) |
| | | _resolve() |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.updateStatus() |
| | | _resolve() |
| | | }) |
| | |
| | | return |
| | | } |
| | | this.outerCallbackRequest(params, res, record, outParam, _resolve) |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') return |
| | | this.outerCallbackRequest(params, {status: false, message: 500, ErrCode: 'E', ErrMesg: 500}, record, outParam, _resolve) |
| | | }) |
| | | } |
| | |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') { |
| | | let param = { |
| | | func: 's_visitor_login', |
| | | timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), |
| | | SessionUid: 'bh0bapabtd45epsgra79segbch6c1ibk', |
| | | TypeCharOne: 'pc', |
| | | appkey: '202004041613277377A6A2456D34A4948AE84' |
| | | } |
| | | |
| | | param.LText = md5(window.btoa('bh0bapabtd45epsgra79segbch6c1ibk' + param.timestamp)) |
| | | param.secretkey = md5(param.LText + 'mingke' + param.timestamp) |
| | | |
| | | let params = { |
| | | url: 'https://sso.mk9h.cn/webapi/dologon', |
| | | method: 'post', |
| | | data: JSON.stringify(param) |
| | | } |
| | | |
| | | Api.directRequest(params) |
| | | |
| | | return |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | |
| | | className = 'mk-btn mk-' + (btn.class || 'unset') |
| | | } |
| | | |
| | | if (loadingNumber && !loadingTotal && btn.$toolbtn && (!btn.show || btn.show === 'button')) { |
| | | label = (loadingNumber && !loadingTotal ? `(${loadingNumber})` : '') + btn.label |
| | | if (loadingNumber && btn.progress !== 'progressbar' && btn.$toolbtn && (!btn.show || btn.show === 'button')) { |
| | | label = (loadingNumber ? `(${loadingNumber})` : '') + btn.label |
| | | } |
| | | |
| | | return <> |
| | |
| | | |
| | | return Api.getSystemCacheConfig(param) |
| | | }).then(result => { |
| | | if (!result) { |
| | | if (!result || result.ErrCode === 'LoginError') { |
| | | this.setState({ loading: false }) |
| | | return |
| | | } |
| | |
| | | |
| | | return Api.genericInterface(res) |
| | | }).then(response => { |
| | | if (!response) return |
| | | if (!response || response.ErrCode === 'LoginError') return |
| | | |
| | | if (ver_token && response.ErrMesg === 'token_error') { |
| | | this.execError(response) |
| | |
| | | _resolve({next: false, list: []}) |
| | | } |
| | | }).then(response => { |
| | | if (!response) return |
| | | if (!response || response.ErrCode === 'LoginError') return |
| | | |
| | | if (response.status) { |
| | | _list.push(response) |
| | |
| | | item.options = fromJS(item.oriOptions).toJS() |
| | | } |
| | | item.linkSubField = null |
| | | } else if (item.type === 'switch' && item.linkSubField) { |
| | | item.options = [] |
| | | item.subFields = [] |
| | | item.linkSubField.forEach(m => { |
| | | let n = fieldMap.get(m) |
| | | if (n && ['text', 'number', 'textarea'].includes(n.type)) { |
| | | item.subFields.push({ |
| | | uuid: n.uuid, |
| | | field: m |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | if (item.subFields.length === 0) { |
| | | item.subFields = null |
| | | } else { |
| | | reFieldsVal = reFieldsVal || {} |
| | | |
| | | let val = item.initval === item.openVal ? item.openText : item.closeText |
| | | |
| | | item.subFields.forEach(n => { |
| | | reFieldsVal[n.field] = val || '' |
| | | }) |
| | | } |
| | | item.linkSubField = null |
| | | } |
| | | |
| | | // if (item.type === 'link') { |
| | |
| | | className = 'checkcard' |
| | | content = (<MKCheckCard config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)}/>) |
| | | } else if (item.type === 'switch') { |
| | | content = (<MKSwitch config={item} onChange={(val) => this.recordChange({[item.field]: val}, item)}/>) |
| | | content = (<MKSwitch config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)}/>) |
| | | } else if (item.type === 'check') { |
| | | content = (<MKCheck config={item} onChange={(val) => this.recordChange({[item.field]: val}, item)}/>) |
| | | } else if (item.type === 'checkbox') { |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { Switch } from 'antd' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | |
| | | class MKSwitch extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.object, |
| | |
| | | onChange = (val) => { |
| | | const { config } = this.props |
| | | |
| | | let other = {} |
| | | if (config.subFields) { |
| | | let _val = val ? config.openText : config.closeText |
| | | config.subFields.forEach((n, i) => { |
| | | other[n.field] = _val || '' |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkFC', 'input', n.uuid, _val || '') |
| | | }, i * 5) |
| | | }) |
| | | } |
| | | |
| | | if (val) { |
| | | this.props.onChange(config.openVal) |
| | | this.props.onChange(config.openVal, other) |
| | | } else { |
| | | this.props.onChange(config.closeVal) |
| | | this.props.onChange(config.closeVal, other) |
| | | } |
| | | } |
| | | |
| | |
| | | } else { |
| | | this.props.onSend(send_type, timestamp, n_id) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') { |
| | | let param = { |
| | | func: 's_visitor_login', |
| | | timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), |
| | | SessionUid: 'bh0bapabtd45epsgra79segbch6c1ibk', |
| | | TypeCharOne: 'pc', |
| | | appkey: '202004041613277377A6A2456D34A4948AE84' |
| | | } |
| | | |
| | | param.LText = md5(window.btoa('bh0bapabtd45epsgra79segbch6c1ibk' + param.timestamp)) |
| | | param.secretkey = md5(param.LText + 'mingke' + param.timestamp) |
| | | |
| | | let params = { |
| | | url: 'https://sso.mk9h.cn/webapi/dologon', |
| | | method: 'post', |
| | | data: JSON.stringify(param) |
| | | } |
| | | |
| | | Api.directRequest(params) |
| | | |
| | | return |
| | | } |
| | | |
| | | clearTimeout(this.timer) |
| | | this.setState({ |
| | | verdisabled: false, |
| | |
| | | } else { |
| | | this.props.onSend(send_type, timestamp, n_id) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') { |
| | | let param = { |
| | | func: 's_visitor_login', |
| | | timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), |
| | | SessionUid: 'bh0bapabtd45epsgra79segbch6c1ibk', |
| | | TypeCharOne: 'pc', |
| | | appkey: '202004041613277377A6A2456D34A4948AE84' |
| | | } |
| | | |
| | | param.LText = md5(window.btoa('bh0bapabtd45epsgra79segbch6c1ibk' + param.timestamp)) |
| | | param.secretkey = md5(param.LText + 'mingke' + param.timestamp) |
| | | |
| | | let params = { |
| | | url: 'https://sso.mk9h.cn/webapi/dologon', |
| | | method: 'post', |
| | | data: JSON.stringify(param) |
| | | } |
| | | |
| | | Api.directRequest(params) |
| | | |
| | | return |
| | | } |
| | | |
| | | clearTimeout(this.timer) |
| | | this.setState({ |
| | | verdisabled: false, |
| | |
| | | {/* 编辑搜索条件 */} |
| | | <Modal |
| | | title={card && card.copyType === 'search' ? '搜索条件-复制' : '搜索条件-编辑'} |
| | | wrapClassName="mk-scroll-modal" |
| | | visible={visible} |
| | | width={850} |
| | | maskClosable={false} |
| | |
| | | type: 'text', |
| | | key: 'separator', |
| | | label: '连接符', |
| | | initVal: card.separator === undefined ? '/' : card.separator, |
| | | initVal: card.separator === undefined ? ',' : card.separator, |
| | | tooltip: '表单提交时信息之间的连接符。注:连接符为空时,初始化时填充其他表单无效。', |
| | | required: false, |
| | | readonly: false |
| | |
| | | type: 'multiselect', |
| | | key: 'linkSubField', |
| | | label: '填充表单', |
| | | tooltip: '在切换选项时会把信息自动填入关联的表单(文本或数字表单)中。', |
| | | tooltip: '在切换选项时会把信息自动填入关联的表单(文本或数字表单)中,开关会将提示文本填入此表单。', |
| | | initVal: card.linkSubField || [], |
| | | options: inputfields |
| | | }, |
| | |
| | | multiselect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'dropdown'], |
| | | link: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'setAll', 'linkField', 'linkSubField', 'span', 'place', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom', 'pickerMode'], |
| | | fileupload: ['readonly', 'required', 'readin', 'fieldlength', 'maxfile', 'fileType', 'span', 'labelwidth', 'tooltip', 'extra', 'compress', 'miniSet', 'splitline', 'marginTop', 'marginBottom', 'maxSize'], |
| | | switch: ['initval', 'openVal', 'closeVal', 'openText', 'closeText', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom'], |
| | | switch: ['initval', 'openVal', 'closeVal', 'openText', 'closeText', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'linkSubField', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom'], |
| | | check: ['initval', 'openVal', 'closeVal', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom', 'checkTip'], |
| | | date: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'place', 'marginTop', 'marginBottom', 'minDate', 'maxDate', 'precision'], |
| | | datemonth: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'place', 'marginTop', 'marginBottom'], |
| | |
| | | {btn.Ot !== 'requiredOnce' ? <Col span={7}> |
| | | <Form.Item label="验证类型"> |
| | | {getFieldDecorator('verifyType', { |
| | | initialValue: 'physical', |
| | | initialValue: 'logic', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | forbid = false |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | if (sessionStorage.getItem('devError') === 'true') { |
| | | sessionStorage.clear() |
| | | window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') |
| | | window.location.reload() |
| | | return |
| | | } |
| | | |
| | | if (!sessionStorage.getItem('UserID')) { |
| | | sessionStorage.removeItem('isEditState') |
| | | this.props.history.replace('/login') |
| | | return |
| | | } |
| | | |
| | | window.GLOB.developing = true |
| | | |
| | | document.body.className = '' |
| | | this.getAppList() |
| | | this.getSmStemp() |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | if (sessionStorage.getItem('devError') === 'true') { |
| | | sessionStorage.clear() |
| | | window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') |
| | | window.location.reload() |
| | | return |
| | | } |
| | | |
| | | if (!sessionStorage.getItem('UserID')) { |
| | | sessionStorage.removeItem('isEditState') |
| | | this.props.history.replace('/login') |
| | | return |
| | | } |
| | | |
| | | window.GLOB.developing = true |
| | | |
| | | try { |
| | | let param = JSON.parse(window.decodeURIComponent(window.atob(this.props.match.params.param))) |
| | | |
| | |
| | | interface: window.GLOB.baseurl + 'webapi/dostars', |
| | | method: 'POST', |
| | | params: [], |
| | | raw: "{\n \"func\":\"******\",\n \"LoginUID\":\"" + (sessionStorage.getItem('LoginUID') || "******") + "\",\n \"UserID\":\"" + (sessionStorage.getItem('UserID') || "******") + "\",\n \"nonc\":\"" + Utils.getguid() + "\",\n \"t\":" + parseInt(new Date().getTime() / 1000) + "\n}", |
| | | raw: "{\n \"func\":\"******\",\n \"LoginUID\":\"@loginuid@\",\n \"UserID\":\"@userid@\",\n \"nonc\":\"" + Utils.getguid() + "\",\n \"t\":" + parseInt(new Date().getTime() / 1000) + "\n}", |
| | | id: 'dologon' |
| | | } |
| | | MKEmitter.emit('useInterface', m) |
| | |
| | | } else if (config.active === 'raw') { |
| | | if (config.raw) { |
| | | try { |
| | | raws = JSON.parse(config.raw) |
| | | raws = config.raw.replace(/@userid@/ig, sessionStorage.getItem('UserID') || '').replace(/@LoginUID@/ig, sessionStorage.getItem('LoginUID') || '') |
| | | raws = JSON.parse(raws) |
| | | } catch (e) { |
| | | Modal.error({ |
| | | title: '参数格式错误,必须为JSON格式!' |
| | |
| | | <Radio value={'formData'}>formData</Radio> |
| | | <Radio value={'raw'}>raw</Radio> |
| | | </Radio.Group> |
| | | {active === 'raw' ? <span style={{float: 'right', color: '#a5a5a5', fontSize: '13px'}}>注:使用@userid@、@loginuid@时将自动替换。</span> : null} |
| | | </div> |
| | | <div className={'body-content ' + (active === 'none' ? 'show' : '')}> |
| | | <div className="no-body">This request does not have a body</div> |
| | |
| | | import React, { Component } from 'react' |
| | | import { message, Modal, notification } from 'antd' |
| | | import { message, Modal } from 'antd' |
| | | import md5 from 'md5' |
| | | import moment from 'moment' |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | if (sessionStorage.getItem('loginError')) { |
| | | try { |
| | | let res = JSON.parse(sessionStorage.getItem('loginError')) |
| | | console.info(res.url) |
| | | console.info(res.request) |
| | | console.info(res.response) |
| | | |
| | | let result = JSON.parse(res.response) |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } catch (e) {} |
| | | |
| | | setTimeout(() => { |
| | | sessionStorage.removeItem('loginError') |
| | | }, 2000) |
| | | } |
| | | |
| | | const _addressUrl = _href + 'queryAddress' |
| | | |
| | | if (localStorage.getItem(_addressUrl) === 'true') { |
| | |
| | | authError: res.message |
| | | }) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') { |
| | | let param = { |
| | | func: 's_visitor_login', |
| | | timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), |
| | | SessionUid: _id, |
| | | TypeCharOne: 'pc', |
| | | appkey: '202004041613277377A6A2456D34A4948AE84' |
| | | } |
| | | |
| | | param.LText = md5(window.btoa(_id + param.timestamp)) |
| | | param.secretkey = md5(param.LText + 'mingke' + param.timestamp) |
| | | |
| | | let params = { |
| | | url: _rduri.replace('dostars', 'dologon'), |
| | | method: 'post', |
| | | data: JSON.stringify(param) |
| | | } |
| | | |
| | | Api.directRequest(params) |
| | | |
| | | return |
| | | } |
| | | |
| | | if (index === -1 || index > 10) { |
| | | this.setState({ |
| | | auth: false, |
| | |
| | | }) |
| | | message.warning(res.message) |
| | | } |
| | | }, () => { |
| | | }, (error) => { |
| | | if (error && error.ErrCode === 'LoginError') { |
| | | let param = { |
| | | func: 's_visitor_login', |
| | | timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), |
| | | SessionUid: 'bh0bapabtd45epsgra79segbch6c1ibk', |
| | | TypeCharOne: 'pc', |
| | | appkey: '202004041613277377A6A2456D34A4948AE84' |
| | | } |
| | | |
| | | param.LText = md5(window.btoa('bh0bapabtd45epsgra79segbch6c1ibk' + param.timestamp)) |
| | | param.secretkey = md5(param.LText + 'mingke' + param.timestamp) |
| | | |
| | | let params = { |
| | | url: 'https://sso.mk9h.cn/webapi/dologon', |
| | | method: 'post', |
| | | data: JSON.stringify(param) |
| | | } |
| | | |
| | | Api.directRequest(params) |
| | | |
| | | return |
| | | } |
| | | |
| | | if (LoginVerCodeTimer) { |
| | | clearTimeout(LoginVerCodeTimer) |
| | | } |