| | |
| | | } else if (res.class !== cell.class || res.show !== cell.show || !res.style) { |
| | | let cl = res.class.replace('border-', '') |
| | | let style = {} |
| | | if (res.show === 'link' || res.show === 'icon') { |
| | | style.color = color[cl] |
| | | style.backgroundColor = 'transparent' |
| | | } else if (res.class === 'default') { |
| | | if (res.class === 'default') { |
| | | style.color = 'rgba(0, 0, 0, 0.65)' |
| | | style.backgroundColor = '#fff' |
| | | style.borderColor = '#d9d9d9' |
| | |
| | | color: orange; |
| | | float: right; |
| | | margin: 5px; |
| | | clear: left; |
| | | } |
| | | } |
| | | .menu-prop-card-edit-box::after { |
| | |
| | | shows = ['typeName', 'label', 'actionType'] |
| | | } else if (this.record.type === 'next') { |
| | | shows = ['typeName', 'label', 'actionType'] |
| | | } else if (this.record.type === 'close') { |
| | | } else if (this.record.type === 'close' || this.record.type === 'reset') { |
| | | shows = ['typeName', 'label'] |
| | | } else { |
| | | shows = ['typeName', 'label', 'intertype', 'Ot', 'execSuccess', 'syncComponent', 'anchors', 'linkmenu', 'output', 'reload'] // 选项列表 |
| | |
| | | _type = '下一步' |
| | | } else if (card.type === 'close') { |
| | | _type = '关闭' |
| | | } else if (card.type === 'reset') { |
| | | _type = '重置' |
| | | } |
| | | |
| | | let menulist = [] |
| | |
| | | group.nextButton.style = style |
| | | } else if (card.type === 'close') { |
| | | group.closeButton.style = style |
| | | } else if (card.type === 'reset') { |
| | | group.resetButton.style = style |
| | | } |
| | | |
| | | this.props.updateconfig(group) |
| | |
| | | } else if (res.type === 'close') { |
| | | res.enable = group.closeButton.enable || 'true' |
| | | group.closeButton = res |
| | | } else if (res.type === 'reset') { |
| | | res.enable = group.resetButton.enable || 'true' |
| | | group.resetButton = res |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | } trigger="hover"> |
| | | <Button type="link" className="submit mk-primary" onDoubleClick={this.changeMenu} style={resetStyle(group.subButton.style)}>{group.subButton.label}</Button> |
| | | </Popover> |
| | | {group.resetButton && group.resetButton.enable === 'true' ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.handleAction(group.resetButton)} /> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={() => this.handleStyle(group.resetButton)}/> |
| | | </div> |
| | | } trigger="hover"> |
| | | <Button type="link" className="reset" style={resetStyle(group.resetButton.style)}>{group.resetButton.label}</Button> |
| | | </Popover> : null} |
| | | {group.closeButton && group.closeButton.enable === 'true' ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.handleAction(group.closeButton)} /> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={() => this.handleStyle(group.closeButton)}/> |
| | | </div> |
| | | } trigger="hover"> |
| | | <Button type="link" style={resetStyle(group.closeButton.style)}>{group.closeButton.label}</Button> |
| | | <Button type="link" className="reset" style={resetStyle(group.closeButton.style)}>{group.closeButton.label}</Button> |
| | | </Popover> : null} |
| | | {group.nextButton && group.nextButton.enable === 'true' ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | |
| | | height: auto; |
| | | right: 0px; |
| | | } |
| | | .reset { |
| | | height: auto; |
| | | } |
| | | } |
| | |
| | | |
| | | res.enable = buttons.includes('enable') ? 'true' : 'false' |
| | | res.closeEnable = buttons.includes('closeEnable') ? 'true' : 'false' |
| | | res.resetEnable = buttons.includes('resetEnable') ? 'true' : 'false' |
| | | |
| | | _card.wrap = res |
| | | |
| | |
| | | } else if (_card.subcards[0].closeButton) { |
| | | _card.subcards[0].closeButton.enable = _card.wrap.closeEnable |
| | | } |
| | | if (_card.wrap.resetEnable === 'true' && !_card.subcards[0].resetButton) { |
| | | _card.subcards[0].resetButton = {label: '重置', enable: 'true', type: 'reset', style: {backgroundColor: '#ffffff', color: 'rgba(0,0,0,0.65)', borderColor: '#d9d9d9', borderWidth: '1px', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px', marginLeft: '10px'}} |
| | | } else if (_card.subcards[0].resetButton) { |
| | | _card.subcards[0].resetButton.enable = _card.wrap.resetEnable |
| | | } |
| | | |
| | | this.updateComponent(_card) |
| | | } |
| | |
| | | if (wrap.closeEnable === 'true') { |
| | | buttons.push('closeEnable') |
| | | } |
| | | if (wrap.resetEnable === 'true') { |
| | | buttons.push('resetEnable') |
| | | } |
| | | |
| | | const wrapForm = [ |
| | | { |
| | |
| | | required: false, |
| | | options: [ |
| | | {value: 'enable', label: '提交'}, |
| | | {value: 'resetEnable', label: '重置'}, |
| | | {value: 'closeEnable', label: '关闭'}, |
| | | ], |
| | | }, |
| | |
| | | 'line-through': '中划线', |
| | | 'icon': '图标', |
| | | 'iconfront': '图标', |
| | | 'iconback': '图标', |
| | | 'iconback': '图标' |
| | | } |
| | | |
| | | if (text[0] === 'indent') { |
| | | return ( |
| | | <div>缩进/{text[1]}个字符</div> |
| | | ) |
| | | } else if (text[0] === 'pointfront') { |
| | | return ( |
| | | <div><span style={{display: 'inline-block', width: '8px', height: '8px', borderRadius: '14px', background: 'black', verticalAlign: 'middle'}}></span> 点(前)</div> |
| | | ) |
| | | } else if (text[0] === 'pointback') { |
| | | return ( |
| | | <div>点(后) <span style={{display: 'inline-block', width: '8px', height: '8px', borderRadius: '14px', background: 'black', verticalAlign: 'middle'}}></span></div> |
| | | ) |
| | | } |
| | | |
| | | return ( |
| | |
| | | }) |
| | | } |
| | | ] |
| | | |
| | | let signs = [ |
| | | { |
| | | value: 'font', |
| | |
| | | label: '中划线' |
| | | }, |
| | | { |
| | | value: 'pointfront', |
| | | label: '点(前)' |
| | | }, |
| | | { |
| | | value: 'pointback', |
| | | label: '点(后)' |
| | | }, |
| | | { |
| | | value: 'iconfront', |
| | | label: '图标(前)', |
| | | children: icons |
| | |
| | | value: 'iconback', |
| | | label: '图标(后)', |
| | | children: icons |
| | | }, |
| | | { |
| | | value: 'indent', |
| | | label: '缩进', |
| | | children: [{ |
| | | value: 2, |
| | | label: '2个字符' |
| | | }, { |
| | | value: 4, |
| | | label: '4个字符' |
| | | }, { |
| | | value: 6, |
| | | label: '6个字符' |
| | | }, { |
| | | value: 8, |
| | | label: '8个字符' |
| | | }] |
| | | } |
| | | ] |
| | | |
| | | if (type === 'line' || type === 'sequence') { |
| | | signs.pop() |
| | | signs.pop() |
| | | signs.pop() |
| | | signs.pop() |
| | | signs.pop() |
| | | } else if (type === 'slider') { |
| | | markColumns = markColumns.filter(col => { |
| | | col.width = '20%' |
| | |
| | | </div> : null} |
| | | <Modal |
| | | visible={!!visible} |
| | | width={visible !== 'system' ? 600 : 1000} |
| | | width={visible !== 'system' ? 650 : 1000} |
| | | closable={false} |
| | | maskClosable={false} |
| | | okText="确定" |
| | |
| | | |
| | | return ( |
| | | <div className="mk-source-pop-wrap"> |
| | | {keyword === 'input' ? <Form.Item label="地址" labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={{xs: { span: 24 }, sm: { span: 20 }}}> |
| | | {keyword === 'input' ? <Form.Item label="地址" help="可使用@mywebsite@代替域名(含虚拟目录),如:@mywebsite@/Content/images/xxx.jpg" labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={{xs: { span: 24 }, sm: { span: 20 }}}> |
| | | <TextArea id="source-input" value={url} rows={4} onChange={this.changeValue}/> |
| | | </Form.Item> : null} |
| | | {keyword === 'upload' ? <Form.Item label="上传" labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={{xs: { span: 24 }, sm: { span: 20 }}}> |
| | |
| | | position: relative; |
| | | top: -15px; |
| | | } |
| | | .ant-form-explain { |
| | | margin-top: 5px; |
| | | word-break: break-all; |
| | | } |
| | | } |
| | | .picture-edit-model { |
| | | .ant-modal { |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { DndProvider, DragSource, DropTarget } from 'react-dnd' |
| | | import { Table, Popover, Modal, message, notification } from 'antd' |
| | | import { Table, Popover, Modal, message, notification, Typography } from 'antd' |
| | | import { PlusOutlined, PlusSquareOutlined, EditOutlined, CopyOutlined, DeleteOutlined, FontColorsOutlined, CloseCircleOutlined, AntDesignOutlined } from '@ant-design/icons' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | | const { Paragraph } = Typography |
| | | const EditColumn = asyncComponent(() => import('./editColumn')) |
| | | const MarkColumn = asyncIconComponent(() => import('@/menu/components/share/markcomponent')) |
| | | const CardCellComponent = asyncComponent(() => import('@/menu/components/card/cardcellcomponent')) |
| | |
| | | } |
| | | return ( |
| | | <td style={{...style}} className={className}> |
| | | {val} |
| | | {column.field ? <Paragraph className="col-copy" copyable={{ text: column.field }}>{val}</Paragraph> : val} |
| | | {column.Hide === 'true' ? <CloseCircleOutlined style={{marginLeft: '5px', color: 'orange', fontSize: '12px'}}/> : null} |
| | | {column.marks && column.marks.length ? <AntDesignOutlined className="profile"/> : null} |
| | | </td> |
| | |
| | | tr { |
| | | td { |
| | | background: #ffffff; |
| | | .col-copy { |
| | | margin-bottom: 0; |
| | | display: inline-block; |
| | | color: inherit; |
| | | .ant-typography-copy { |
| | | position: absolute; |
| | | left: 2px; |
| | | top: 0px; |
| | | margin-left: 0px; |
| | | font-size: 12px; |
| | | opacity: 0; |
| | | transition: opacity 0.2s; |
| | | } |
| | | } |
| | | } |
| | | td:hover .col-copy { |
| | | .ant-typography-copy { |
| | | opacity: 1; |
| | | } |
| | | } |
| | | td:not(.ant-table-selection-column) { |
| | | position: relative; |
| | |
| | | import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | | const { Paragraph } = Typography |
| | | const { Paragraph } = Typography |
| | | const EditColumn = asyncComponent(() => import('./editColumn')) |
| | | const MarkColumn = asyncIconComponent(() => import('@/menu/components/share/markcomponent')) |
| | | const CardCellComponent = asyncComponent(() => import('@/menu/components/card/cardcellcomponent')) |
| | |
| | | |
| | | if (res.columns) { |
| | | res.columns = res.columns.map(item => { |
| | | |
| | | if (/int/ig.test(item.datatype)) { |
| | | item.type = 'number' |
| | | item.decimal = 0 |
| | | } else if (/Decimal/ig.test(item.datatype)) { |
| | | item.type = 'number' |
| | | item.decimal = +item.datatype.replace(/^Decimal\(18,/ig, '').replace(/\)/ig, '') |
| | | } else if (/^date/ig.test(item.datatype)) { |
| | | item.type = 'text' |
| | | item.fieldlength = 50 |
| | | } else { |
| | | item.type = 'text' |
| | | item.fieldlength = +item.datatype.replace(/^Nvarchar\(/ig, '').replace(/\)/ig, '') |
| | |
| | | if (config.subtype !== 'dualdatacard') { |
| | | delete res.subColumns |
| | | } else { |
| | | res.subColumns = res.subColumns.map(item => { |
| | | if (/int/ig.test(item.datatype)) { |
| | | item.type = 'number' |
| | | item.decimal = 0 |
| | | } else if (/Decimal/ig.test(item.datatype)) { |
| | | item.type = 'number' |
| | | item.decimal = +item.datatype.replace(/^Decimal\(18,/ig, '').replace(/\)/ig, '') |
| | | } else if (/^date/ig.test(item.datatype)) { |
| | | item.type = 'text' |
| | | item.fieldlength = 50 |
| | | } else { |
| | | item.type = 'text' |
| | | item.fieldlength = +item.datatype.replace(/^Nvarchar\(/ig, '').replace(/\)/ig, '') |
| | | } |
| | | return item |
| | | }) |
| | | |
| | | res.subColumns.reverse() |
| | | } |
| | | |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Tabs, Popconfirm, notification, Modal, Typography, Spin, message, Button, Input } from 'antd' |
| | | import { StopOutlined, CheckCircleOutlined, EditOutlined, SwapOutlined, DeleteOutlined, CopyOutlined, BorderOutlined, SnippetsOutlined } from '@ant-design/icons' |
| | | import { StopOutlined, CheckCircleOutlined, TableOutlined, EditOutlined, SwapOutlined, DeleteOutlined, CopyOutlined, BorderOutlined, SnippetsOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | |
| | |
| | | <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} searchKey={searchKey} type="datasourcefield" wrappedComponentRef={(inst) => this.datasource = inst} data={columns} columns={colColumns} onChange={(columns) => this.setState({columns})}/> |
| | | </TabPane> : <TabPane tab={ |
| | | <span> |
| | | 字段集 |
| | | 字段集<TableOutlined style={{marginLeft: '5px', fontSize: '12px'}} /> |
| | | {columns.length ? <span className="count-tip">{columns.length}</span> : null} |
| | | </span> |
| | | } key="columns"> |
| | |
| | | |
| | | card.backElements.forEach(cell => { |
| | | if (cell.eleType !== 'button' || cell.hidden === 'true') return |
| | | let sql = this.resetButton(item, cell, process) |
| | | let sql = this.resetButton(item, cell, process, null, true) |
| | | |
| | | if (sql) { |
| | | if (typeof(sql) === 'string') { |
| | |
| | | }) |
| | | } |
| | | |
| | | resetButton = (item, cell, process, group) => { |
| | | resetButton = (item, cell, process, group, isback) => { |
| | | let sql = '' |
| | | if (['exec', 'prompt', 'pop', 'form', 'formSubmit'].includes(cell.OpenType)) { |
| | | if (cell.intertype === 'system' || cell.procMode === 'system') { // 系统接口 |
| | | sql = this.getSysDefaultSql(cell, item, process, group) |
| | | if (item.subtype === 'dualdatacard' && isback) { |
| | | let _item = fromJS(item).toJS() |
| | | _item.columns = _item.subColumns || [] |
| | | _item.setting.primaryKey = _item.setting.subKey |
| | | sql = this.getSysDefaultSql(cell, _item, process, group) |
| | | } else { |
| | | sql = this.getSysDefaultSql(cell, item, process, group) |
| | | } |
| | | } |
| | | } else if (cell.OpenType === 'excelIn') { |
| | | if (cell.intertype === 'system') { |
| | |
| | | } else { |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } else if (mark.space) { |
| | | val = <><span style={{float: 'left'}} dangerouslySetInnerHTML={{__html: mark.space}}></span>{val}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | val = <>{mark.point}{val}</> |
| | | } else { |
| | | val = <>{val}{mark.point}</> |
| | | } |
| | | } |
| | | className = mark.signType |
| | | } |
| | |
| | | val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> |
| | | } else { |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } else if (mark.space) { |
| | | val = <><span style={{float: 'left'}} dangerouslySetInnerHTML={{__html: mark.space}}></span>{val}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | val = <>{mark.point}{val}</> |
| | | } else { |
| | | val = <>{val}{mark.point}</> |
| | | } |
| | | } |
| | | className = mark.signType |
| | |
| | | let func = new Function('data', card.formula) |
| | | val = func(_data) |
| | | } catch (e) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.warn(e) |
| | | } |
| | | console.warn(e) |
| | | val = '' |
| | | } |
| | | } else if (card.$sync) { |
| | |
| | | // eslint-disable-next-line |
| | | _val = eval(_val) |
| | | } catch (e) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.info(_val) |
| | | console.warn(e) |
| | | } |
| | | console.info(_val) |
| | | console.warn(e) |
| | | _val = 0 |
| | | } |
| | | } |
| | |
| | | // eslint-disable-next-line |
| | | _val = eval(_val) |
| | | } catch (e) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.info(_val) |
| | | console.warn(e) |
| | | } |
| | | console.info(_val) |
| | | console.warn(e) |
| | | _val = '' |
| | | } |
| | | } |
| | |
| | | } else { |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } else if (mark.space) { |
| | | val = <><span style={{float: 'left'}} dangerouslySetInnerHTML={{__html: mark.space}}></span>{val}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | val = <>{mark.point}{val}</> |
| | | } else { |
| | | val = <>{val}{mark.point}</> |
| | | } |
| | | } |
| | | className = mark.signType |
| | | } |
| | |
| | | }) |
| | | graph.on('edge:click', ({ edge }) => { |
| | | this.selectNode = edge |
| | | |
| | | |
| | | this.setState({node: edge.store.data}) |
| | | |
| | | graph.clearTransformWidgets() |
| | |
| | | let start_num = 0 |
| | | let end_num = 0 |
| | | let unvalid = false |
| | | let map = new Map() |
| | | let appMap = new Map() |
| | | |
| | | nodes.cells.forEach(item => { |
| | | if (item.mknode === 'start') { |
| | | if (item.shape === 'mk-text' || item.shape === 'lane') return |
| | | |
| | | if (!item.mkdata) { |
| | | unvalid = true |
| | | } else if (item.mknode === 'start') { |
| | | start_num++ |
| | | } else if (item.mknode === 'end') { |
| | | end_num++ |
| | | } else if (item.shape === 'edge' && item.mknode !== 'endEdge' && item.mknode !== 'startEdge') { |
| | | if (!item.mkdata.members || item.mkdata.members.length === 0) { |
| | | } else if (item.shape === 'edge') { |
| | | if (item.mknode !== 'endEdge' && item.mknode !== 'startEdge' && (!item.mkdata.members || item.mkdata.members.length === 0)) { |
| | | unvalid = true |
| | | } else if (item.mknode === 'startEdge' || item.mkdata.flowType === 'reject') { |
| | | if (map.has(item.source.cell)) { |
| | | unvalid = true |
| | | } else { |
| | | map.set(item.source.cell, true) |
| | | } |
| | | } else if (item.mkdata.flowType === 'approval' || item.mknode === 'endEdge') { |
| | | let val = '' |
| | | if (item.mkdata.execCondition === 'open') { |
| | | val = item.mkdata.match + item.mkdata.matchVal |
| | | } |
| | | if (appMap.has(item.source.cell + val)) { |
| | | unvalid = true |
| | | } else { |
| | | appMap.set(item.source.cell + val, true) |
| | | } |
| | | } |
| | | } |
| | | |
| | | }) |
| | | |
| | | if (start_num !== 1 || end_num !== 1 || unvalid) { |
| | | _status = 0 |
| | | } |
| | |
| | | let start_num = 0 |
| | | let end_num = 0 |
| | | let unvalidId = '' |
| | | |
| | | let emptyNode = null |
| | | let emptyEdge = null |
| | | let map = new Map() |
| | | let appMap = new Map() |
| | | let rejectId = '' |
| | | let approvalId = '' |
| | | |
| | | nodes.cells.forEach(item => { |
| | | if (item.mknode === 'start') { |
| | | if (item.shape === 'mk-text' || item.shape === 'lane') return |
| | | |
| | | if (!item.mkdata) { |
| | | if (item.shape !== 'edge') { |
| | | if (!emptyNode) { |
| | | emptyNode = item |
| | | } |
| | | } else { |
| | | if (!emptyEdge) { |
| | | emptyEdge = item |
| | | } |
| | | } |
| | | } else if (item.mknode === 'start') { |
| | | start_num++ |
| | | } else if (item.mknode === 'end') { |
| | | end_num++ |
| | | } else if (item.shape === 'edge' && item.mknode !== 'endEdge' && item.mknode !== 'startEdge') { |
| | | if (!item.mkdata.members || item.mkdata.members.length === 0) { |
| | | } else if (item.shape === 'edge' && !unvalidId && !rejectId && !approvalId) { |
| | | if (item.mknode !== 'endEdge' && item.mknode !== 'startEdge' && (!item.mkdata.members || item.mkdata.members.length === 0)) { |
| | | unvalidId = item.id |
| | | } else if (item.mknode === 'startEdge' || item.mkdata.flowType === 'reject') { |
| | | if (map.has(item.source.cell)) { |
| | | rejectId = item.source.cell |
| | | } else { |
| | | map.set(item.source.cell, true) |
| | | } |
| | | } else if (item.mkdata.flowType === 'approval' || item.mknode === 'endEdge') { |
| | | let val = '' |
| | | if (item.mkdata.execCondition === 'open') { |
| | | val = item.mkdata.match + item.mkdata.matchVal |
| | | } |
| | | if (appMap.has(item.source.cell + val)) { |
| | | approvalId = item.source.cell |
| | | } else { |
| | | appMap.set(item.source.cell + val, item) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | |
| | | message: '结束节点不可添加多个!', |
| | | duration: 2 |
| | | }) |
| | | } else if (unvalidId) { |
| | | let edge = this.mkGraph.getCellById(unvalidId) |
| | | } else if (emptyNode) { |
| | | let errmsg = '部分节点未设置基本信息。' |
| | | if (emptyNode.attrs && emptyNode.attrs.text && emptyNode.attrs.text.text) { |
| | | errmsg = '节点《' + emptyNode.attrs.text.text + '》未设置基本信息。' |
| | | } |
| | | notification.warning({ |
| | | top: 92, |
| | | message: errmsg, |
| | | duration: 2 |
| | | }) |
| | | } else if (emptyEdge) { |
| | | let errmsg = '部分连线未设置基本信息。' |
| | | |
| | | let node = edge.getTargetCell() |
| | | let edge = this.mkGraph.getCellById(emptyEdge.id) |
| | | let target = edge.getTargetCell() |
| | | |
| | | let t_label = '' |
| | | if (target.attrs && target.attrs.text && target.attrs.text.text) { |
| | | t_label = target.attrs.text.text |
| | | } |
| | | |
| | | let source = edge.getSourceCell() |
| | | |
| | | let s_label = '' |
| | | if (source.attrs && source.attrs.text && source.attrs.text.text) { |
| | | s_label = source.attrs.text.text |
| | | } |
| | | |
| | | if (t_label && s_label) { |
| | | errmsg = '节点《' + s_label + '》与节点《' + t_label + '》间连线未设置基本信息。' |
| | | } |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: errmsg, |
| | | duration: 2 |
| | | }) |
| | | } else if (rejectId) { |
| | | let node = this.mkGraph.getCellById(rejectId) |
| | | |
| | | let title = '' |
| | | if (node.attrs && node.attrs.text) { |
| | | title = node.attrs.text.text + '' |
| | | if (node.attrs && node.attrs.text && node.attrs.text.text) { |
| | | title = '节点《' + node.attrs.text.text + '》' |
| | | } else if (node.mkdata) { |
| | | title = '状态:' + node.mkdata.status + ' - ' + node.mkdata.statusName |
| | | } |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '连接(' + title + ')的线未设置审批人!', |
| | | message: title + ' 不可设置两条驳回连线!', |
| | | duration: 2 |
| | | }) |
| | | } else if (approvalId) { |
| | | let node = this.mkGraph.getCellById(approvalId) |
| | | |
| | | let title = '' |
| | | if (node.attrs && node.attrs.text && node.attrs.text.text) { |
| | | title = '节点《' + node.attrs.text.text + '》' |
| | | } else if (node.mkdata) { |
| | | title = '状态:' + node.mkdata.status + ' - ' + node.mkdata.statusName |
| | | } |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: title + ' 后的审批分支执行条件重复!', |
| | | duration: 2 |
| | | }) |
| | | } else if (unvalidId) { |
| | | let edge = this.mkGraph.getCellById(unvalidId) |
| | | |
| | | let node = edge.getTargetCell() |
| | | |
| | | let title = '' |
| | | if (node.attrs && node.attrs.text && node.attrs.text.text) { |
| | | title = node.attrs.text.text |
| | | } else if (node.mkdata) { |
| | | title = '状态:' + node.mkdata.status + ' - ' + node.mkdata.statusName |
| | | } |
| | | |
| | | let source = edge.getSourceCell() |
| | | |
| | | let s_label = '' |
| | | if (source.attrs && source.attrs.text && source.attrs.text.text) { |
| | | s_label = source.attrs.text.text |
| | | } else if (source.mkdata) { |
| | | s_label = '状态:' + source.mkdata.status + ' - ' + source.mkdata.statusName |
| | | } |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '节点《' + s_label + '》与《' + title + '》间连线未设置审批人!', |
| | | duration: 2 |
| | | }) |
| | | } else { |
| | |
| | | visible={visible} |
| | | closable={false} |
| | | maskClosable={false} |
| | | width={1000} |
| | | width={1050} |
| | | onOk={this.confirm} |
| | | onCancel={() => this.setState({visible: false})} |
| | | destroyOnClose |
| | |
| | | background-image: none; |
| | | border: 1px solid #d9d9d9; |
| | | border-radius: 4px; |
| | | vertical-align: middle; |
| | | |
| | | .anticon-form { |
| | | float: right; |
| | |
| | | |
| | | return ( |
| | | <> |
| | | <div className="member-input">{value.length}人<FormOutlined onClick={this.trigger} /></div> |
| | | <div className="member-input">{value.length > 0 ? value.length + '人' : ''}<FormOutlined onClick={this.trigger} /></div> |
| | | <Modal |
| | | wrapClassName="member-modal" |
| | | title="选择人员" |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Radio, Tooltip, InputNumber } from 'antd' |
| | | import { Form, Row, Col, Input, Radio, Tooltip, InputNumber, Switch } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | |
| | | import MemberForm from './memberform' |
| | |
| | | } |
| | | |
| | | state = { |
| | | flowType: this.props.data.flowType || 'approval' |
| | | flowType: this.props.data.flowType || 'approval', |
| | | execCondition: this.props.data.execCondition === 'open', |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | if (values.execCondition === true) { |
| | | values.execCondition = 'open' |
| | | } else if (values.execCondition === false) { |
| | | values.execCondition = 'close' |
| | | } |
| | | |
| | | if (values.matchVal) { |
| | | values.matchVal = values.matchVal.replace(/\t+|\v+|\s+/g, '') |
| | | } |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | |
| | | render() { |
| | | const { node, orgs } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { flowType } = this.state |
| | | const { flowType, execCondition } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {nodetype === 'edge' && flowType !== 'reject' ? <Col span={12}> |
| | | <Form.Item label="执行条件"> |
| | | {getFieldDecorator('execCondition', { |
| | | valuePropName: 'checked', |
| | | initialValue: execCondition |
| | | })( |
| | | <Switch checkedChildren="开启" unCheckedChildren="关闭" onChange={(val) => this.setState({execCondition: val})} /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {nodetype === 'edge' && flowType !== 'reject' && execCondition ? <Col span={12}> |
| | | <Form.Item label="对比方式"> |
| | | {getFieldDecorator('match', { |
| | | initialValue: data.match || '=' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="=">=</Radio> |
| | | <Radio value="<"><</Radio> |
| | | <Radio value=">">></Radio> |
| | | <Radio value="<="><=</Radio> |
| | | <Radio value=">=">>=</Radio> |
| | | <Radio value="!=">!=</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {nodetype === 'edge' && flowType !== 'reject' && execCondition ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="对比值中不可包含制表符、空格、换行符等。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 对比值 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('matchVal', { |
| | | initialValue: data.matchVal || '' |
| | | })( |
| | | <Input placeholder="" autoComplete="off"/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {nodetype === 'node' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="标记将作为节点ID"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 标记 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('sign', { |
| | | initialValue: data.sign || '' |
| | | })( |
| | | <Input placeholder="" autoComplete="off"/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={24}> |
| | | <Form.Item label="备注"> |
| | | {getFieldDecorator('remark', { |
| | |
| | | |
| | | let _group = _config.subcards[0] |
| | | |
| | | if (_group.subButton.enable === 'false' && (!_group.closeButton || _group.closeButton.enable !== 'true')) { |
| | | if (_group.subButton.enable === 'false' && (!_group.closeButton || _group.closeButton.enable !== 'true') && (!_group.resetButton || _group.resetButton.enable !== 'true')) { |
| | | _group.subButton.style.display = 'none' |
| | | _group.$button = 'no-button' |
| | | } |
| | |
| | | MKEmitter.emit('closeTabView', group.subButton.$MenuID) |
| | | } |
| | | |
| | | resetTab = () => { |
| | | const { data } = this.state |
| | | |
| | | this.setState({ |
| | | data: null |
| | | }, () => { |
| | | this.setState({data: data}) |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { config, loading, BID, BData, data, group } = this.state |
| | | |
| | |
| | | columns={config.columns} |
| | | selectedData={data.$$empty ? [] : [data]} |
| | | /> |
| | | {group.resetButton && group.resetButton.enable === 'true' ? <Button type="link" onClick={this.resetTab} style={group.resetButton.style}>{group.resetButton.label}</Button> : null} |
| | | {group.closeButton && group.closeButton.enable === 'true' ? <Button type="link" onClick={this.closeTab} style={group.closeButton.style}>{group.closeButton.label}</Button> : null} |
| | | </div> : null} |
| | | </div> |
| | |
| | | } |
| | | |
| | | setBook = (item, resolve) => { |
| | | const { config } = this.props |
| | | |
| | | if (!resolve) { |
| | | this.setState({activeItem: item}) |
| | | |
| | | MKEmitter.emit('resetSelectLine', this.props.config.uuid, item.id, item) |
| | | MKEmitter.emit('resetSelectLine', config.uuid, item.id, item) |
| | | } |
| | | |
| | | let userid = sessionStorage.getItem('UserID') || '' |
| | |
| | | } |
| | | |
| | | if (resolve) { |
| | | sessionStorage.setItem('ThirdMenu', config.$pageId) |
| | | window.location.reload() |
| | | } |
| | | }) |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | if (col.blur) { |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | let func = new Function('data', col.formula) |
| | | content = func([record]) |
| | | } catch (e) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.warn(e) |
| | | } |
| | | console.warn(e) |
| | | content = '' |
| | | } |
| | | } else { |
| | |
| | | // eslint-disable-next-line |
| | | content = eval(content) |
| | | } catch (e) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.info(content) |
| | | console.warn(e) |
| | | } |
| | | console.info(content) |
| | | console.warn(e) |
| | | content = '' |
| | | } |
| | | |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | let func = new Function('data', col.formula) |
| | | content = func([record]) |
| | | } catch (e) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.warn(e) |
| | | } |
| | | console.warn(e) |
| | | content = '' |
| | | } |
| | | } else { |
| | |
| | | // eslint-disable-next-line |
| | | content = eval(content) |
| | | } catch (e) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.info(content) |
| | | console.warn(e) |
| | | } |
| | | console.info(content) |
| | | console.warn(e) |
| | | content = '' |
| | | } |
| | | } |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | let func = new Function('data', col.formula) |
| | | content = func([record]) |
| | | } catch (e) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.warn(e) |
| | | } |
| | | console.warn(e) |
| | | content = '' |
| | | } |
| | | } else { |
| | |
| | | // eslint-disable-next-line |
| | | content = eval(content) |
| | | } catch (e) { |
| | | if (window.GLOB.debugger === true) { |
| | | console.info(content) |
| | | console.warn(e) |
| | | } |
| | | console.info(content) |
| | | console.warn(e) |
| | | content = '' |
| | | } |
| | | } |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | config.$cache = config.cacheLocal === 'true' |
| | | config.$time = config.localCacheTime || 0 |
| | | |
| | | if (window.GLOB.systemType !== 'production' && result.modifydate) { |
| | | let s = (new Date().getTime() - new Date(result.modifydate).getTime()) / (1000 * 60 * 60) |
| | | if (!isNaN(s) && s < 2) { |
| | | config.$cache = false |
| | | config.$time = 0 |
| | | config.cacheUseful = 'false' |
| | | } |
| | | } |
| | | |
| | | let initInters = [] |
| | | |
| | | config.interfaces = this.formatInterSetting(config.interfaces, regs, MenuID, initInters) |
| | |
| | | const { btn } = this.props |
| | | |
| | | let imgCol = false |
| | | let columns = btn.verify.columns.filter(col => { |
| | | let columns = btn.verify.columns.map(col => { |
| | | if (col.type === 'image') { |
| | | imgCol = true |
| | | } |
| | |
| | | _item.value = _item.value.replace(/\t+|\v+/g, '') // 去除制表符 |
| | | |
| | | if (item.interception !== 'false') { // 去除首尾空格 |
| | | _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') |
| | | if (item.interception === 'func') { |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('value', 'data', item.func) |
| | | _item.value = func(_item.value, _data) |
| | | _item.value = _item.value !== undefined ? _item.value : '' |
| | | } catch (e) { |
| | | console.warn(e) |
| | | _item.value = '' |
| | | } |
| | | } else { |
| | | _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') |
| | | } |
| | | } |
| | | if (_item.type === 'text' && /@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 特殊字段替换 |
| | | _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (BID || '')) |
| | |
| | | _item.value = _item.value.replace(/\t+|\v+/g, '') // 去除制表符 |
| | | |
| | | if (item.interception !== 'false') { // 去除首尾空格 |
| | | _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') |
| | | if (item.interception === 'func') { |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('value', 'data', item.func) |
| | | _item.value = func(_item.value, _data) |
| | | _item.value = _item.value !== undefined ? _item.value : '' |
| | | } catch (e) { |
| | | console.warn(e) |
| | | _item.value = '' |
| | | } |
| | | } else { |
| | | _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') |
| | | } |
| | | } |
| | | if (_item.type === 'text' && /@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 特殊字段替换 |
| | | _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (this.props.BID || '')) |
| | |
| | | _item.value = _item.value.replace(/\t+|\v+/g, '') // 去除制表符 |
| | | |
| | | if (item.interception !== 'false') { // 去除首尾空格 |
| | | _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') |
| | | if (item.interception === 'func') { |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('value', 'data', item.func) |
| | | _item.value = func(_item.value, record) |
| | | _item.value = _item.value !== undefined ? _item.value : '' |
| | | } catch (e) { |
| | | console.warn(e) |
| | | _item.value = '' |
| | | } |
| | | } else { |
| | | _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') |
| | | } |
| | | } |
| | | if (item.type === 'text' && /@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 特殊字段替换 |
| | | _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (this.props.BID || '')) |
| | |
| | | <Button className="excel-col-add mk-red" title="清空Excel列" onClick={this.clearField}> |
| | | 清空Excel列 |
| | | </Button> |
| | | <div style={{color: '#959595', fontSize: '13px', paddingLeft: '10px'}}>如需导出序号,请使用字段 $Index;数值类型导出时可进行数据处理(取绝对值、保留小数位);红色标题导出时列头文字为红色。</div> |
| | | <div style={{color: '#959595', fontSize: '13px', paddingLeft: '10px'}}>如需导出序号,请使用字段 $Index;数值类型导出时可取绝对值以及设置小数位;导出为否时,不使用行信息;红色标题导出时列头文字为红色。</div> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del']} type="excelcolumn" wrappedComponentRef={(inst) => this.columnRef = inst} data={verify.columns} columns={excelColumns} onChange={this.changeColumns}/> |
| | | </TabPane> |
| | | {card.intertype === 'system' ? <TabPane tab={ |
| | |
| | | let custompage = /@pageSize@|@orderBy@/i.test(_dataresource + _customScript) |
| | | |
| | | // 正则替换 |
| | | let _regoptions = regoptions.map(item => { |
| | | return { |
| | | reg: new RegExp('@' + item.key + '@', 'ig'), |
| | | value: `'0'` |
| | | } |
| | | }) |
| | | |
| | | _regoptions.push({ |
| | | regoptions.push({ |
| | | reg: new RegExp('@orderBy@', 'ig'), |
| | | value: verify.order |
| | | }, { |
| | |
| | | value: 1 |
| | | }) |
| | | |
| | | _regoptions.forEach(item => { |
| | | regoptions.forEach(item => { |
| | | _dataresource = _dataresource.replace(item.reg, item.value) |
| | | _customScript = _customScript.replace(item.reg, item.value) |
| | | _tailScript = _tailScript.replace(item.reg, item.value) |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'interception', |
| | | label: '截取空格', |
| | | label: '截取方式', |
| | | initVal: card.interception || 'true', |
| | | tooltip: '提交时,是否截取首尾的空白字符。', |
| | | tooltip: '提交时的文本处理方式,空白字符指开头或结尾的空白字符。', |
| | | options: [{ |
| | | value: 'true', |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: '否' |
| | | text: '无' |
| | | }, { |
| | | value: 'true', |
| | | text: '空白字符' |
| | | }, { |
| | | value: 'func', |
| | | text: '自定义函数' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'func', |
| | | label: '函数', |
| | | initVal: card.func || '', |
| | | tooltip: '函数有两个入参(value, data),第一个为当前表单值,第二个为表单所有字段-值的对象,请返回处理后的值。', |
| | | rows: 2, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | |
| | | type: 'radio', |
| | | key: 'constant', |
| | | label: 'Unicode常量', |
| | | tooltip: '使用时将在提交内容前加上 N,代表存入数据库时以 Unicode 格式存储。', |
| | | tooltip: `使用时将在提交内容前加上 N,代表存入数据库时以 Unicode 格式存储。例如:@nvarchar=N'ØW30041'。`, |
| | | initVal: card.constant || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | |
| | | shows.push('regularExtra') |
| | | } |
| | | } |
| | | if (this.record.interception === 'func') { |
| | | shows.push('func') |
| | | } |
| | | } else if (type === 'number') { |
| | | reTypes.initval = 'number' |
| | | reRequired.initval = true |
| | |
| | | shows.push('fieldlength') |
| | | } else if (this.record.declare === 'decimal') { |
| | | shows.push('decimal') |
| | | } |
| | | if (this.record.interception === 'func') { |
| | | shows.push('func') |
| | | } |
| | | } else if (['multiselect', 'select', 'link', 'radio', 'checkbox'].includes(type)) { |
| | | if (this.record.resourceType === '0') { // 自定义资源 |
| | |
| | | if (this.record.encryption === 'false') { |
| | | shows.push('enterReplace') |
| | | } |
| | | if (this.record.interception === 'func') { |
| | | shows.push('func') |
| | | } |
| | | } |
| | | |
| | | if (['multiselect', 'select', 'link', 'radio', 'checkbox', 'checkcard', 'cascader'].includes(type)) { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { unionFields, verify, notes, card, appType } = this.props |
| | | const { unionFields, verify, notes, card, appType, columns } = this.props |
| | | const { wxTemps, selectTemp } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | } |
| | | } |
| | | |
| | | let _columns = [] |
| | | if (window.GLOB.process) { |
| | | _columns = columns.filter(col => { |
| | | if (!col.field) return false |
| | | if (col.field.toLowerCase() === 'id') return false |
| | | if (col.type === 'text' && col.fieldlength > 100) return false |
| | | |
| | | return true |
| | | }) |
| | | } |
| | | |
| | | return ( |
| | |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {window.GLOB.process && verify.workFlow === 'true' && verify.flowType === 'approval' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="bottomLeft" title="如果审批存在多条分支,可添加审批流程的控制字段,通过行信息控制流程走向。注:需在流程图中完善分支的执行条件。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 流程控制 |
| | | </Tooltip> |
| | | }> |
| | | <Select allowClear value={verify.flowBranch} onChange={(val) => {this.onOptionChange(val || '', 'flowBranch')}}> |
| | | {_columns.map(option => |
| | | <Select.Option key={option.field} value={option.field}> |
| | | {option.label} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={24}></Col> |
| | | <Col span={8}> |
| | | <Form.Item label={ |
| | |
| | | oriVerify: fromJS(_verify).toJS() |
| | | }) |
| | | |
| | | if (config.Template !== 'FormTab' && card.intertype === 'inner') { |
| | | if (card.intertype === 'inner') { |
| | | return |
| | | } |
| | | |
| | |
| | | field: card.field, |
| | | label: card.label, |
| | | type: 'text' |
| | | }) |
| | | resolve(_fields) |
| | | } else if (config.Template === 'FormTab') { |
| | | config.groups.forEach(group => { |
| | | _fields.push(...group.sublist) |
| | | }) |
| | | resolve(_fields) |
| | | } else if (card.modal && (card.OpenType === 'pop' || !card.OpenType)) { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { card } = this.props |
| | | const { card, columns } = this.props |
| | | const { activeKey, verifyInter, setting, verify, fields, uniqueFields, uniqueColumns, unionFields, onceUniqueColumns, columnsFields, contrastColumns, customColumns, orderColumns, scriptsColumns, cbScriptsColumns, orderModular, orderModularDetail, voucher, voucherDetail, notes, appType } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | {verify.default === 'false' ? <span className="count-tip"><ExclamationOutlined style={{color: 'orange'}}/></span> : null} |
| | | </span> |
| | | } key="base"> |
| | | <BaseForm card={card} appType={appType} unionFields={unionFields} setting={setting} verify={verify} notes={notes} onChange={(verify) => this.setState({verify})} wrappedComponentRef={(inst) => this.baseForm = inst}/> |
| | | <BaseForm card={card} appType={appType} columns={columns} unionFields={unionFields} setting={setting} verify={verify} notes={notes} onChange={(verify) => this.setState({verify})} wrappedComponentRef={(inst) => this.baseForm = inst}/> |
| | | </TabPane> : null} |
| | | {verifyInter === 'system' ? <TabPane tab={ |
| | | <span> |
| | |
| | | fields={fields} |
| | | btn={this.props.card} |
| | | billcodes={verify.billcodes} |
| | | columns={this.props.columns} |
| | | columns={columns} |
| | | modular={orderModular} |
| | | modularDetail={orderModularDetail} |
| | | orderChange={this.orderChange} |
| | |
| | | } key="voucher"> |
| | | <VoucherForm |
| | | voucher={voucher} |
| | | columns={this.props.columns} |
| | | columns={columns} |
| | | voucherobj={verify.voucher} |
| | | voucherDetail={voucherDetail} |
| | | voucherChange={this.voucherChange} |
| | |
| | | if (item.setting && item.setting.supModule && item.setting.supModule[0] !== 'empty') { |
| | | item.setting.supModule = '' |
| | | } |
| | | |
| | | if (item.wrap && item.wrap.supType === 'multi') { |
| | | item.wrap.supType = 'single' |
| | | |
| | | delete item.supNodes |
| | | } |
| | | |
| | | if (item.wrap && item.wrap.supModule) { |
| | | item.wrap.supModule = '' |
| | | } |
| | |
| | | } else if (card.type !== 'balcony' && !card.setting.supModule) { // 悬浮框上级组件需单独设置 |
| | | errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | if (card.subtype === 'dualdatacard' && card.subColumns) { |
| | | card.subColumns.forEach(col => { |
| | | columns.push(col.field) |
| | | }) |
| | | } |
| | | } else if ((card.type === 'balcony' || card.type === 'card') && card.wrap.datatype === 'public') { |
| | | columns = card.columns.map(c => c.field) |
| | | } |
| | |
| | | let doubleClick = '' |
| | | if (card.type === 'table') { |
| | | doubleClick = card.wrap.doubleClick || '' |
| | | } |
| | | |
| | | let checkBtn = (cell) => { |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (!cell.modal || cell.modal.fields.length === 0) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中表单尚未添加`}) |
| | | } |
| | | } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导入列未设置!`}) |
| | | } else if (cell.OpenType === 'excelOut') { |
| | | if (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导出列未设置!`}) |
| | | } else if (cell.intertype === 'system' && cell.verify.dataType !== 'custom' && card.$c_ds && columns.length > 0) { |
| | | let cols = [] |
| | | cell.verify.columns.forEach(col => { |
| | | if (col.output === 'false' || col.Column === '$Index') return |
| | | if (!columns.includes(col.Column)) { |
| | | cols.push(col.Column) |
| | | } |
| | | }) |
| | | if (cols.length) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导出列(${cols.join('、')})在字段集中不存在!`}) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (card.$c_ac) { |
| | |
| | | // errors.push({ level: 0, detail: `按钮“${cell.label}”中弹窗标签未启用`}) |
| | | // } |
| | | // } |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (!cell.modal || cell.modal.fields.length === 0) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中表单尚未添加`}) |
| | | } |
| | | } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导入列未设置!`}) |
| | | } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导出列未设置!`}) |
| | | } |
| | | checkBtn(cell) |
| | | if (doubleClick === cell.uuid) { |
| | | doubleClick = '' |
| | | } |
| | |
| | | item.elements.forEach(cell => { |
| | | if (cell.eleType === 'button') { |
| | | if (cell.hidden === 'true') return |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (!cell.modal || cell.modal.fields.length === 0) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中表单尚未添加`}) |
| | | } |
| | | } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导入列未设置!`}) |
| | | } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导出列未设置!`}) |
| | | } |
| | | checkBtn(cell) |
| | | if (linkbtn && linkbtn === cell.uuid) { |
| | | linkbtn = '' |
| | | } |
| | |
| | | item.backElements.forEach(cell => { |
| | | if (cell.eleType === 'button') { |
| | | if (cell.hidden === 'true') return |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (!cell.modal || cell.modal.fields.length === 0) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中表单尚未添加`}) |
| | | } |
| | | } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导入列未设置!`}) |
| | | } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导出列未设置!`}) |
| | | } |
| | | checkBtn(cell) |
| | | if (linkbtn && linkbtn === cell.uuid) { |
| | | linkbtn = '' |
| | | } |
| | |
| | | card.elements.forEach(cell => { |
| | | if (cell.eleType === 'button') { |
| | | if (cell.hidden === 'true') return |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (!cell.modal || cell.modal.fields.length === 0) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中表单尚未添加`}) |
| | | } |
| | | } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导入列未设置!`}) |
| | | } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导出列未设置!`}) |
| | | } |
| | | checkBtn(cell) |
| | | } else if (cell.datatype === 'dynamic' && cell.field && !columns.includes(cell.field)) { |
| | | errors.push({ level: 1, detail: `卡片中动态字段“${cell.field}”无效`}) |
| | | } |
| | |
| | | col.elements.forEach(cell => { |
| | | if (cell.eleType === 'button') { |
| | | if (cell.hidden === 'true') return |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (!cell.modal || cell.modal.fields.length === 0) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中表单尚未添加`}) |
| | | } |
| | | } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导入列未设置!`}) |
| | | } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导出列未设置!`}) |
| | | } |
| | | |
| | | checkBtn(cell) |
| | | |
| | | if (doubleClick === cell.uuid) { |
| | | doubleClick = '' |
| | |
| | | } |
| | | |
| | | if (_customScript) { |
| | | if (LText) { |
| | | if (DateCount) { |
| | | DateCount = `${DateCount} |
| | | ${_tailScript} |
| | | aaa: |
| | | if @ErrorCode!='' |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,'${sessionStorage.getItem('UserID') || ''}' |
| | | ` |
| | | } else if (LText) { |
| | | LText = `${LText} |
| | | ${_tailScript} |
| | | aaa: |
| | |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,'${sessionStorage.getItem('UserID') || ''}' |
| | | ` |
| | | } |
| | | } else if (_tailScript && DateCount) { |
| | | LText = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) |
| | | Select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}' |
| | | ${LText} |
| | | ` |
| | | DateCount = `${DateCount} |
| | | ${_tailScript} |
| | | aaa: |
| | | if @ErrorCode!='' |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,'${sessionStorage.getItem('UserID') || ''}' |
| | | ` |
| | | } else if (_tailScript) { |
| | | LText = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) |
| | | Select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}' |
| | |
| | | if (window.GLOB.debugger === true) { |
| | | _customScript && console.info(`${setting.$name ? `/*${setting.$name} 自定义脚本*/\n` : ''}${LText ? '' : '/*不执行默认sql*/\n'}${_customScript}`) |
| | | LText && console.info(`${setting.$name ? `/*${setting.$name} 数据源*/\n` : ''}` + LText.replace(/\n\s{8}/ig, '\n')) |
| | | DateCount && console.info(`${setting.$name ? `/*${setting.$name} 总数查询*/\n` : ''}` + DateCount.replace(/\n\s{8}/ig, '\n')) |
| | | } |
| | | |
| | | if (setting.$name) { |
| | |
| | | import React from 'react' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | |
| | |
| | | let status = 0 |
| | | let statusName = '' |
| | | let detailId = '' |
| | | let error = '' |
| | | |
| | | if (verify.flowType === 'start') { |
| | | target = flow.cells.filter(cell => cell.mknode === 'start')[0] |
| | |
| | | detailId = target.id |
| | | status = target.mkdata.status |
| | | statusName = target.mkdata.statusName |
| | | } else { |
| | | error = '工作流无开始节点' |
| | | } |
| | | } else if (_data.works_flow_param) { |
| | | node = JSON.parse(window.decodeURIComponent(window.atob(_data.works_flow_param))) |
| | | try { |
| | | node = JSON.parse(window.decodeURIComponent(window.atob(_data.works_flow_param))) |
| | | } catch (e) { |
| | | node = null |
| | | } |
| | | |
| | | if (node) { |
| | | let lines = flow.cells.filter(cell => cell.shape === 'edge' && cell.source.cell === node.id) |
| | | if (verify.flowType === 'reject') { |
| | | line = lines.filter(cell => cell.mkdata.flowType === 'reject' || cell.mknode === 'startEdge')[0] |
| | | } else { |
| | | line = lines.filter(cell => cell.mkdata.flowType !== 'reject' && cell.mknode !== 'startEdge')[0] |
| | | let endEdge = null |
| | | lines = lines.filter(cell => { |
| | | if (cell.mknode === 'endEdge') { |
| | | endEdge = cell |
| | | return false |
| | | } |
| | | |
| | | return cell.mkdata.flowType !== 'reject' && cell.mknode !== 'startEdge' |
| | | }) |
| | | |
| | | if (lines.length === 0) { |
| | | if (!endEdge) { |
| | | error = '无可执行的流程分支' |
| | | } else { |
| | | line = endEdge |
| | | } |
| | | } else { |
| | | let branchKey = verify.flowBranch ? verify.flowBranch.toLowerCase() : '' |
| | | |
| | | if (!branchKey) { |
| | | lines.forEach(line => { |
| | | if (line.mkdata.execCondition === 'open') { |
| | | error = '按钮未设置流程控制字段。' |
| | | } |
| | | }) |
| | | if (!error) { |
| | | line = lines[0] |
| | | } |
| | | } else if (!_data.hasOwnProperty(branchKey)) { |
| | | error = '行信息中无流程控制字段。' |
| | | } else { |
| | | if (endEdge) { |
| | | line = endEdge |
| | | } |
| | | |
| | | let equalLine = null |
| | | let gtOrLtLine = [] |
| | | let unEqualLine = null |
| | | let branchVal = _data[branchKey] |
| | | |
| | | if (branchVal && typeof(branchVal) === 'string' && !isNaN(branchVal)) { |
| | | branchVal = +branchVal |
| | | } |
| | | |
| | | lines.forEach(item => { |
| | | if (item.mkdata.execCondition !== 'open') { |
| | | line = item |
| | | } else { |
| | | if (item.mkdata.match === '=') { |
| | | if (item.mkdata.matchVal === branchVal + '') { |
| | | equalLine = item |
| | | } |
| | | } else if (item.mkdata.match === '!=') { |
| | | if (item.mkdata.matchVal !== branchVal + '') { |
| | | unEqualLine = item |
| | | } |
| | | } else { |
| | | if (item.mkdata.match === '<') { |
| | | if (item.mkdata.matchVal < branchVal) { |
| | | gtOrLtLine.push({...item, dist: Math.abs(item.mkdata.matchVal - branchVal)}) |
| | | } |
| | | } else if (item.mkdata.match === '>') { |
| | | if (item.mkdata.matchVal > branchVal) { |
| | | gtOrLtLine.push({...item, dist: Math.abs(item.mkdata.matchVal - branchVal)}) |
| | | } |
| | | } else if (item.mkdata.match === '<=') { |
| | | if (item.mkdata.matchVal <= branchVal) { |
| | | gtOrLtLine.push({...item, dist: Math.abs(item.mkdata.matchVal - branchVal)}) |
| | | } |
| | | } else if (item.mkdata.match === '>=') { |
| | | if (item.mkdata.matchVal >= branchVal) { |
| | | gtOrLtLine.push({...item, dist: Math.abs(item.mkdata.matchVal - branchVal)}) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | |
| | | if (equalLine) { |
| | | line = equalLine |
| | | } else if (gtOrLtLine.length > 0) { |
| | | gtOrLtLine.sort((a, b) => a.dist - b.dist) |
| | | line = gtOrLtLine[0] |
| | | } else if (unEqualLine) { |
| | | line = unEqualLine |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | error = '行信息中工作流参数无法解析' |
| | | } |
| | | |
| | | if (line) { |
| | |
| | | status = line.mkdata.status |
| | | statusName = line.mkdata.statusName |
| | | target = flow.cells.filter(cell => cell.id === line.target.cell)[0] |
| | | } else if (!error) { |
| | | error = '工作流中无对应流程' |
| | | } |
| | | } else { |
| | | error = '行信息中无工作流参数' |
| | | } |
| | | |
| | | if (verify.flowSql === 'true' && target) { |
| | |
| | | ` |
| | | } |
| | | } else if (verify.flowSql === 'true') { |
| | | target = flow.cells.filter(cell => cell.mknode === 'start')[0] |
| | | |
| | | if (target) { |
| | | detailId = target.id |
| | | } |
| | | |
| | | status = 0 |
| | | statusName = '异常' |
| | | |
| | | _sql += ` |
| | | /* 工作流异常sql */ |
| | | update s_my_works_flow set status=@status@,statusname=@statusname@,works_flow_param=@works_flow_param@,works_flow_detail_id=@works_flow_detail_id@,modifydate=getdate(),modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname |
| | | where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 |
| | | insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,upid) |
| | | select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@time_id@ |
| | | select @ErrorCode='E',@retmsg='${error || '工作流执行异常'}' goto aaa |
| | | ` |
| | | } |
| | | |
| | |
| | | * @description 获取标记信息 |
| | | */ |
| | | export function getMark (marks, record, style = {}) { |
| | | let icon = null |
| | | let innerStyle = null |
| | | let position = null |
| | | let signType = '' |
| | | let res = {} |
| | | style = JSON.parse(JSON.stringify(style)) |
| | | |
| | | marks.some(mark => { |
| | |
| | | |
| | | if (type === 'font') { |
| | | style.color = mark.color |
| | | innerStyle = {color: mark.color} |
| | | signType = ' sign-font' |
| | | res.innerStyle = {color: mark.color} |
| | | res.signType = ' sign-font' |
| | | } else if (type === 'background') { |
| | | style.backgroundColor = mark.color |
| | | if (mark.fontColor) { |
| | | style.color = mark.fontColor |
| | | innerStyle = {color: mark.fontColor} |
| | | res.innerStyle = {color: mark.fontColor} |
| | | } |
| | | } else if (type === 'underline') { |
| | | style.textDecoration = 'underline' |
| | | style.color = mark.color |
| | | innerStyle = {color: mark.color, textDecoration: 'underline'} |
| | | res.innerStyle = {color: mark.color, textDecoration: 'underline'} |
| | | } else if (type === 'line-through') { |
| | | style.textDecoration = 'line-through' |
| | | style.color = mark.color |
| | | innerStyle = {color: mark.color, textDecoration: 'line-through'} |
| | | res.innerStyle = {color: mark.color, textDecoration: 'line-through'} |
| | | } else if (type.indexOf('icon') > -1) { |
| | | icon = mark.signType[mark.signType.length - 1] |
| | | innerStyle = {color: mark.color} |
| | | res.icon = mark.signType[mark.signType.length - 1] |
| | | res.innerStyle = {color: mark.color} |
| | | if (type === 'iconfront' || mark.signType[1] === 'front') { |
| | | position = 'front' |
| | | res.position = 'front' |
| | | } else { |
| | | position = 'back' |
| | | res.position = 'back' |
| | | } |
| | | } else if (type === 'indent') { |
| | | style.color = mark.color |
| | | res.space = Array(mark.signType[1] + 1).join(' ') |
| | | } else if (type === 'pointfront') { |
| | | res.position = 'front' |
| | | res.point = <span style={{display: 'inline-block', marginRight: '3px', width: '8px', height: '8px', borderRadius: '14px', background: mark.color, verticalAlign: 'middle'}}></span> |
| | | } else if (type === 'pointback') { |
| | | res.position = 'back' |
| | | res.point = <span style={{display: 'inline-block', marginLeft: '3px', width: '8px', height: '8px', borderRadius: '14px', background: mark.color, verticalAlign: 'middle'}}></span> |
| | | } |
| | | |
| | | return true |
| | | }) |
| | | |
| | | return { |
| | | style, |
| | | icon, |
| | | innerStyle, |
| | | position, |
| | | signType |
| | | } |
| | | return res |
| | | } |
| | | |
| | | /** |