| | |
| | | label: '上级组件' |
| | | }, { |
| | | value: 'line', |
| | | label: '行' |
| | | label: '数据源' |
| | | }], |
| | | controlFields: [ |
| | | {field: 'rootLabel', values: ['fixed', 'supvalue']}, |
| | |
| | | field: 'rootValue', |
| | | label: '根节点值', |
| | | initval: card.rootValue || '', |
| | | tooltip: '根节点使用上级组件时,请填写上级组件中对应的字段。', |
| | | required: true |
| | | }, |
| | | { |
| | |
| | | field: 'rootLabel', |
| | | label: '根节点文本', |
| | | initval: card.rootLabel || '', |
| | | tooltip: '根节点使用上级组件时,请填写上级组件中对应的字段。', |
| | | required: true |
| | | }, |
| | | { |
| | |
| | | field: 'collapsed', |
| | | label: '节点合并', |
| | | initval: card.collapsed || 'false', |
| | | tooltip: '一级节点是否合并。', |
| | | tooltip: '初始化时,一级节点是否合并。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '否'}, |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | // import { fromJS } from 'immutable' |
| | | import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader } from 'antd' |
| | | import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, notification } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import { formRule } from '@/utils/option.js' |
| | | |
| | |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | if (values.intertype === 'outer' && values.sysInterface === 'true' && !values.outerFunc) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '使用单点系统请填写外部函数!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'sysInterface', |
| | | label: '系统接口', |
| | | label: '系统类型', |
| | | initVal: card.sysInterface || 'false', |
| | | tooltip: '单点登录系统', |
| | | tooltip: '业务系统指同一sso下的其他业务系统', |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '是' |
| | | text: '单点' |
| | | }, { |
| | | value: 'false', |
| | | text: '否' |
| | | text: '业务' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | shows.push('cbTable') |
| | | } |
| | | |
| | | reRequired.outerFunc = false |
| | | if (this.record.sysInterface === 'false') { |
| | | reReadonly.interface = false |
| | | reRequired.interface = true |
| | |
| | | } else if (this.record.sysInterface === 'true') { |
| | | reReadonly.interface = true |
| | | reRequired.interface = false |
| | | reRequired.outerFunc = true |
| | | |
| | | shows.push('interface') |
| | | } else if (this.record.sysInterface === 'external') { |
| | |
| | | shows.push('cbTable') |
| | | } |
| | | |
| | | reRequired.outerFunc = false |
| | | if (this.record.sysInterface === 'false') { |
| | | reReadonly.interface = false |
| | | reRequired.interface = true |
| | |
| | | } else if (this.record.sysInterface === 'true') { |
| | | reReadonly.interface = true |
| | | reRequired.interface = false |
| | | reRequired.outerFunc = true |
| | | |
| | | shows.push('interface') |
| | | } else if (this.record.sysInterface === 'external') { |
| | |
| | | shows.push('innerFunc', 'sysInterface', 'outerFunc', 'callbackFunc') |
| | | reRequired.innerFunc = false |
| | | reRequired.callbackFunc = false |
| | | reRequired.outerFunc = false |
| | | |
| | | if (this.record.sysInterface === 'false') { |
| | | reReadonly.interface = false |
| | |
| | | } else if (this.record.sysInterface === 'true') { |
| | | reReadonly.interface = true |
| | | reRequired.interface = false |
| | | reRequired.outerFunc = true |
| | | |
| | | shows.push('interface') |
| | | } else if (this.record.sysInterface === 'external') { |
| | |
| | | if (this.record.intertype === 'outer') { |
| | | shows.push('innerFunc', 'sysInterface', 'outerFunc') |
| | | reRequired.innerFunc = false |
| | | reRequired.outerFunc = false |
| | | |
| | | if (this.record.sysInterface === 'false') { |
| | | reReadonly.interface = false |
| | |
| | | } else if (this.record.sysInterface === 'true') { |
| | | reReadonly.interface = true |
| | | reRequired.interface = false |
| | | reRequired.outerFunc = true |
| | | |
| | | shows.push('interface') |
| | | } else if (this.record.sysInterface === 'external') { |
| | |
| | | shows.push('innerFunc', 'sysInterface', 'outerFunc', 'callbackFunc') |
| | | reRequired.innerFunc = false |
| | | reRequired.callbackFunc = false |
| | | reRequired.outerFunc = false |
| | | |
| | | if (this.record.sysInterface === 'false') { |
| | | reReadonly.interface = false |
| | |
| | | } else if (this.record.sysInterface === 'true') { |
| | | reReadonly.interface = true |
| | | reRequired.interface = false |
| | | reRequired.outerFunc = true |
| | | |
| | | shows.push('interface') |
| | | } else if (this.record.sysInterface === 'external') { |
| | |
| | | _options.push(_item) |
| | | }) |
| | | |
| | | root = this.getTree(root, _options) |
| | | root.nodeNumber = 0 |
| | | root = this.getTree(root, _options, root) |
| | | root.children = root.children || [] |
| | | |
| | | if (plot.subtype === 'mindmap') { |
| | |
| | | return root |
| | | } |
| | | |
| | | getTree = (parent, options) => { |
| | | getTree = (parent, options, root) => { |
| | | parent.children = [] |
| | | // 添加菜单的子元素 |
| | | options = options.filter(option => { |
| | | if (option.$parentId === parent.id) { |
| | | delete option.$parentId |
| | | parent.children.push(option) |
| | | |
| | | root.nodeNumber++ |
| | | |
| | | return false |
| | | } |
| | | return true |
| | |
| | | parent.children = null |
| | | } else { |
| | | parent.children = parent.children.map(item => { |
| | | item = this.getTree(item, options) |
| | | item = this.getTree(item, options, root) |
| | | |
| | | return item |
| | | }) |
| | |
| | | graph.render() |
| | | graph.fitView() |
| | | |
| | | if (plot.collapsed === 'true') { |
| | | if (plot.collapsed === 'true' || data.nodeNumber < 5) { |
| | | graph.zoomTo(1, { x: 0, y: plot.height / 2 }) |
| | | } |
| | | } |
| | |
| | | |
| | | if (plot.collapsed === 'true' && plot.dirField) { |
| | | tree.zoomTo(1, { x: width / 2, y: plot.height / 2 }) |
| | | } else if (plot.collapsed === 'true') { |
| | | } else if (plot.collapsed === 'true' || data.nodeNumber < 5) { |
| | | tree.zoomTo(1, { x: 0, y: plot.height / 2 }) |
| | | } |
| | | } |
| | |
| | | let _params = [] |
| | | |
| | | if ( btn.Ot === 'notRequired' || btn.Ot === 'requiredSgl' || btn.Ot === 'requiredOnce' ) { |
| | | let param = { |
| | | func: btn.innerFunc || '' |
| | | let param = {} |
| | | |
| | | if (btn.innerFunc) { |
| | | param.func = btn.innerFunc |
| | | } |
| | | |
| | | if (this.props.BID) { |
| | |
| | | let ids = data.map(d => { return d[setting.primaryKey] || ''}) |
| | | ids = ids.filter(Boolean) |
| | | primaryId = ids.join(',') |
| | | } |
| | | |
| | | if (setting.primaryKey) { |
| | | param[setting.primaryKey] = primaryId // 设置主键参数 |
| | | } |
| | | |
| | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LTextOut, param.timestamp) |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) |
| | | } |
| | | |
| | | if (retmsg) { |
| | | param.$callbacksql = this.getSysDeclareSql(btn, formdata, cell, columns, primaryId, this.props.BID) |
| | | } |
| | | |
| | | return param |
| | | }) |
| | | } |
| | | |
| | | return _params |
| | | } |
| | | |
| | | getLineParam = (data, formdata, retmsg) => { |
| | | const { setting, btn, columns } = this.props |
| | | let _params = [] |
| | | |
| | | if (btn.Ot === 'notRequired') { |
| | | if (retmsg) { |
| | | let param = { |
| | | $callbacksql: this.getSysDeclareSql(btn, formdata, data[0], columns, '', this.props.BID) |
| | | } |
| | | |
| | | _params.push(param) |
| | | } else { |
| | | _params.push({}) |
| | | } |
| | | } else if ( btn.Ot === 'requiredSgl' || btn.Ot === 'requiredOnce' ) { |
| | | let param = {} |
| | | |
| | | if (this.props.BID) { |
| | | param.BID = this.props.BID |
| | | } |
| | | |
| | | let primaryId = '' |
| | | |
| | | if ((btn.Ot === 'requiredSgl' || btn.Ot === 'requiredOnce') && setting.primaryKey) { |
| | | let ids = data.map(d => { return d[setting.primaryKey] || ''}) |
| | | ids = ids.filter(Boolean) |
| | | primaryId = ids.join(',') |
| | | } |
| | | |
| | | if (setting.primaryKey) { |
| | | param[setting.primaryKey] = primaryId // 设置主键参数 |
| | | } |
| | | |
| | | if (btn.OpenType === 'pop' || btn.OpenType === 'formSubmit' || btn.OpenType === 'form') { // 表单 |
| | | formdata.forEach(_data => { |
| | | param[_data.key] = _data.value |
| | | }) |
| | | } |
| | | |
| | | if (retmsg) { |
| | | param.$callbacksql = this.getSysDeclareSql(btn, formdata, data[0], columns, primaryId, this.props.BID) |
| | | } |
| | | |
| | | _params.push(param) |
| | | } else if (btn.Ot === 'required') { |
| | | _params = data.map((cell, index) => { |
| | | let param = {} |
| | | |
| | | if (this.props.BID) { |
| | | param.BID = this.props.BID |
| | | } |
| | | |
| | | let primaryId = setting.primaryKey ? cell[setting.primaryKey] || '' : '' |
| | | |
| | | if (btn.OpenType === 'pop') { // 表单 |
| | | if (index !== 0) { |
| | | let _cell = {} |
| | | Object.keys(cell).forEach(key => { |
| | | _cell[key.toLowerCase()] = cell[key] |
| | | }) |
| | | formdata = formdata.map(_data => { |
| | | if (_data.readin && _cell.hasOwnProperty(_data.key.toLowerCase())) { |
| | | _data.value = _cell[_data.key.toLowerCase()] |
| | | } |
| | | return _data |
| | | }) |
| | | } |
| | | |
| | | formdata.forEach(_data => { |
| | | param[_data.key] = _data.value |
| | | }) |
| | | } |
| | | if (setting.primaryKey) { |
| | | param[setting.primaryKey] = primaryId |
| | | } |
| | | |
| | | if (retmsg) { |
| | |
| | | item.script_type = 'Y' |
| | | return item |
| | | }) |
| | | } else if (btn.procMode === 'inner') { |
| | | _params = this.getInnerParam(data, formdata, btn.callbackType === 'script') |
| | | } else { |
| | | _params = this.getLineParam(data, formdata, btn.callbackType === 'script') |
| | | _params = this.getInnerParam(data, formdata, btn.callbackType === 'script') |
| | | } |
| | | |
| | | if (_params.length > 1 && btn.progress === 'progressbar' && btn.$toolbtn) { |
| | |
| | | item.script_type = 'Y' |
| | | return item |
| | | }) |
| | | } else if (btn.procMode === 'inner') { |
| | | params = this.getInnerParam(data, formdata, btn.callbackType === 'script') |
| | | } else { |
| | | params = this.getLineParam(data, formdata, btn.callbackType === 'script') |
| | | params = this.getInnerParam(data, formdata, btn.callbackType === 'script') |
| | | } |
| | | |
| | | if (params.length > 1 && btn.progress === 'progressbar' && btn.$toolbtn) { |