| | |
| | | /* 工作流默认sql */ |
| | | insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) |
| | | select jskey,@works_flow_code@,@works_flow_name@,@works_flow_param@,@status@,@statusname@,@work_group@,@works_flow_detail_id@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@ |
| | | #${sheet} |
| | | from #${sheet} |
| | | |
| | | 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,bid,createuserid,CreateUser,CreateStaff,upid) |
| | | select jskey,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@ |
| | | #${sheet} |
| | | from #${sheet} |
| | | |
| | | insert into s_my_works_flow_notice (works_flow_id,works_flow_code,works_flow_detail_id,userid,notice_type,createuserid,CreateUser,CreateStaff,upid) |
| | | select jskey,@works_flow_code@,@works_flow_detail_id@,@userid@,@start_type@,@userid@,@UserName,@FullName,@time_id@ |
| | | #${sheet} |
| | | from #${sheet} |
| | | |
| | | insert into s_my_works_flow_role (works_flow_id,works_flow_code,userid,works_flow_detail_id,createuserid,CreateUser,CreateStaff,upid,typecharone) |
| | | select jskey,@works_flow_code@,@userid@,@works_flow_detail_id@,@userid@,@UserName,@FullName,@time_id@,'begin' |
| | | #${sheet} |
| | | from #${sheet} |
| | | ` |
| | | } |
| | | |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Modal } from 'antd' |
| | | import { Modal, Empty, Radio } from 'antd' |
| | | import { ForkOutlined } from '@ant-design/icons' |
| | | |
| | | import './index.scss' |
| | |
| | | |
| | | state = { |
| | | visible: false, |
| | | empty: false, |
| | | ctrlFields: [], |
| | | ctrlRFields: [], |
| | | subFields: [], |
| | | subRFields: [], |
| | | linkFields: [], |
| | | tabFields: [], |
| | | type: '', |
| | | forward: 'true', |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | |
| | | trigger = () => { |
| | | const { forms } = this.props |
| | | |
| | | // let linkSubField = [] |
| | | // let supField = [] |
| | | // let tabField = [] |
| | | // let linkField = [] |
| | | |
| | | |
| | | let linkFields = {} // 关联菜单 |
| | | let controlFields = {} // 控制表单 |
| | |
| | | } |
| | | supvals = Array.from(new Set(supvals)) |
| | | controlFields[item.supField] = controlFields[item.supField] || [] |
| | | controlFields[item.supField].push({field: item.field, values: supvals.join(',')}) |
| | | controlFields[item.supField].push({field: item.field, values: supvals.join(','), type: item.type}) |
| | | } else { |
| | | delete item.supField |
| | | delete item.supvalue |
| | |
| | | } else { |
| | | item.tabLabel = fieldMap.get(item.tabField).label |
| | | } |
| | | } |
| | | } else { |
| | | delete item.tabField |
| | | } |
| | | } else { |
| | | delete item.tabField |
| | | } |
| | |
| | | delete item.multiple |
| | | delete item.linkSubField |
| | | |
| | | // if (!item.controlFields && !item.linkFields && !item.subFields && !item.resubFields) |
| | | |
| | | fieldMap.set(item.field, item) |
| | | }) |
| | | |
| | |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | |
| | | let _n = [...fieldMap.values()] |
| | | |
| | | let ctrlFields = [] |
| | | let ctrlRFields = [] |
| | | let subFields = [] |
| | | let subRFields = [] |
| | | let _linkFields = [] |
| | | let tabFields = [] |
| | | |
| | | _n.forEach(cell => { |
| | | if (cell.controlFields) { |
| | | ctrlFields.push({ |
| | | field: cell.field, |
| | | label: cell.label, |
| | | children: cell.controlFields.map(m => { |
| | | return { |
| | | field: ['hint', 'split', 'formula'].includes(m.type) ? '' : m.field, |
| | | label: m.label, |
| | | tail: `${m.values}` |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | if (cell.supField) { |
| | | ctrlRFields.push({ |
| | | field: ['hint', 'split', 'formula'].includes(cell.type) ? '' : cell.field, |
| | | label: cell.label, |
| | | children: [{ |
| | | field: cell.supField, |
| | | label: cell.supLabel, |
| | | tail: `${cell.supvalue}` |
| | | }] |
| | | }) |
| | | } |
| | | |
| | | if (cell.subFields) { |
| | | subFields.push({ |
| | | field: cell.field, |
| | | label: cell.label, |
| | | children: cell.subFields |
| | | }) |
| | | } |
| | | if (cell.resubFields) { |
| | | subRFields.push({ |
| | | field: cell.field, |
| | | label: cell.label, |
| | | children: cell.resubFields |
| | | }) |
| | | } |
| | | if (cell.linkFields) { |
| | | _linkFields.push({ |
| | | field: cell.field, |
| | | label: cell.label, |
| | | children: cell.linkFields |
| | | }) |
| | | } |
| | | if (cell.tabField) { |
| | | tabFields.push({ |
| | | field: cell.field, |
| | | label: cell.label, |
| | | children: [{ |
| | | field: cell.tabField, |
| | | label: cell.tabLabel, |
| | | }] |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | let type = '' |
| | | if (ctrlFields.length > 0) { |
| | | type = 'ctrl' |
| | | } else if (subFields.length > 0) { |
| | | type = 'input' |
| | | } else if (_linkFields.length > 0) { |
| | | type = 'link' |
| | | } else if (tabFields.length > 0) { |
| | | type = 'switch' |
| | | } |
| | | |
| | | this.setState({ |
| | | type, |
| | | forward: 'true', |
| | | empty: type === '', |
| | | ctrlFields, |
| | | ctrlRFields, |
| | | subFields, |
| | | subRFields, |
| | | linkFields: _linkFields, |
| | | tabFields, |
| | | visible: true |
| | | }) |
| | | } |
| | | |
| | | getcontent = () => { |
| | | const { ctrlFields, ctrlRFields, subFields, subRFields, linkFields, tabFields, visible, type, forward } = this.state |
| | | |
| | | if (!visible) return null |
| | | |
| | | let header = <div className="fork-tabs"> |
| | | {ctrlFields.length ? <div onClick={() => this.setState({type: 'ctrl', forward: 'true'})} className={'tab-item' + (type === 'ctrl' ? ' active' : '')}>表单控制</div> : null} |
| | | {subFields.length ? <div onClick={() => this.setState({type: 'input', forward: 'true'})} className={'tab-item' + (type === 'input' ? ' active' : '')}>表单填充</div> : null} |
| | | {linkFields.length ? <div onClick={() => this.setState({type: 'link', forward: 'true'})} className={'tab-item' + (type === 'link' ? ' active' : '')}>表单关联</div> : null} |
| | | {tabFields.length ? <div onClick={() => this.setState({type: 'switch', forward: 'true'})} className={'tab-item' + (type === 'switch' ? ' active' : '')}>表单切换</div> : null} |
| | | </div> |
| | | |
| | | let items = [] |
| | | |
| | | if (type === 'ctrl') { |
| | | if (forward === 'true') { |
| | | items = ctrlFields |
| | | } else { |
| | | items = ctrlRFields |
| | | } |
| | | } else if (type === 'input') { |
| | | if (forward === 'true') { |
| | | items = subFields |
| | | } else { |
| | | items = subRFields |
| | | } |
| | | } else if (type === 'link') { |
| | | items = linkFields |
| | | } else if (type === 'switch') { |
| | | items = tabFields |
| | | } |
| | | |
| | | let content = items.map((item, i) => { |
| | | return <div className="fork-item-wrap" key={i}> |
| | | <div className="fork-left"> |
| | | <div className="fork-item"> |
| | | <span>{item.label}</span> |
| | | <span>{item.field}</span> |
| | | </div> |
| | | </div> |
| | | <div className="fork-right"> |
| | | {item.children.map((cell, n) => <div className="fork-item" key={n}> |
| | | <span>{cell.label}</span> |
| | | <span>{cell.field}</span> |
| | | {cell.tail ? <span className="fork-tail">{cell.tail}</span> : null} |
| | | </div>)} |
| | | </div> |
| | | </div> |
| | | }) |
| | | |
| | | return <div> |
| | | {header} |
| | | {type === 'ctrl' || type === 'input' ? <div className="forward-wrap"><Radio.Group value={forward} onChange={(e) => this.setState({forward: e.target.value})}> |
| | | <Radio value="true">正向</Radio> |
| | | <Radio value="false">反向</Radio> |
| | | </Radio.Group></div> : null} |
| | | <div className="fork-wrap"> |
| | | {content} |
| | | </div> |
| | | </div> |
| | | } |
| | | |
| | | render() { |
| | | const { visible } = this.state |
| | | const { visible, empty } = this.state |
| | | |
| | | return ( |
| | | <> |
| | | <ForkOutlined title="表单关系图" onClick={this.trigger}/> |
| | | <Modal |
| | | title="表单关系图" |
| | | title={empty ? '表单关系图' : ''} |
| | | wrapClassName="form-fork-modal mk-scroll-modal" |
| | | visible={visible} |
| | | width={900} |
| | | maskClosable={false} |
| | | maskClosable={true} |
| | | closable={false} |
| | | cancelText="关闭" |
| | | onOk={() => { this.setState({ visible: false })}} |
| | | onCancel={() => { this.setState({ visible: false })}} |
| | | destroyOnClose |
| | | > |
| | | |
| | | {empty ? <Empty description="无表单关联信息。" /> : this.getcontent()} |
| | | </Modal> |
| | | </> |
| | | ) |
| | |
| | | } |
| | | .ant-modal-body { |
| | | min-height: 350px!important; |
| | | |
| | | .ant-empty { |
| | | margin-top: 50px; |
| | | } |
| | | |
| | | .fork-tabs { |
| | | border-bottom: 1px solid #e8e8e8; |
| | | text-align: center; |
| | | color: rgba(0, 0, 0, 0.85); |
| | | |
| | | .tab-item { |
| | | display: inline-block; |
| | | padding: 4px 12px; |
| | | border-bottom: 2px solid transparent; |
| | | transition: all 0.3s; |
| | | cursor: pointer; |
| | | } |
| | | .tab-item:not(:last-child) { |
| | | margin-right: 10px; |
| | | } |
| | | .tab-item.active { |
| | | border-color: #1890ff; |
| | | } |
| | | } |
| | | .forward-wrap { |
| | | text-align: right; |
| | | padding: 5px; |
| | | } |
| | | .fork-wrap { |
| | | padding-top: 15px; |
| | | } |
| | | .fork-item-wrap { |
| | | display: inline-flex; |
| | | width: 50%; |
| | | margin-bottom: 15px; |
| | | |
| | | .fork-left { |
| | | display: flex; |
| | | width: 50%; |
| | | align-items: center; |
| | | } |
| | | .fork-right { |
| | | display: inline-block; |
| | | width: 50%; |
| | | |
| | | .fork-item:not(:last-child) { |
| | | margin-bottom: 10px; |
| | | } |
| | | .fork-item::before { |
| | | content: ''; |
| | | display: block; |
| | | } |
| | | } |
| | | |
| | | .fork-item { |
| | | position: relative; |
| | | display: block; |
| | | width: 130px; |
| | | border: 1px solid #bcbcbc; |
| | | padding: 5px 10px; |
| | | height: 55px; |
| | | border-radius: 4px; |
| | | color: rgba(0, 0, 0, 0.85); |
| | | span:not(.fork-tail) { |
| | | display: block; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .fork-tail { |
| | | display: inline-block; |
| | | position: absolute; |
| | | top: 10px; |
| | | right: 140px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .ant-modal-footer { |
| | |
| | | |
| | | _value = `insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) |
| | | select jskey,@works_flow_code@,@works_flow_name@,@works_flow_param@,@status@,@statusname@,@work_group@,@works_flow_detail_id@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@ |
| | | #${sheet} |
| | | from #${sheet} |
| | | |
| | | 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,bid,createuserid,CreateUser,CreateStaff,upid) |
| | | select jskey,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@ |
| | | #${sheet} |
| | | from #${sheet} |
| | | |
| | | insert into s_my_works_flow_notice (works_flow_id,works_flow_code,works_flow_detail_id,userid,notice_type,createuserid,CreateUser,CreateStaff,upid) |
| | | select jskey,@works_flow_code@,@works_flow_detail_id@,@userid@,@start_type@,@userid@,@UserName,@FullName,@time_id@ |
| | | #${sheet} |
| | | from #${sheet} |
| | | |
| | | insert into s_my_works_flow_role (works_flow_id,works_flow_code,userid,works_flow_detail_id,createuserid,CreateUser,CreateStaff,upid,typecharone) |
| | | select jskey,@works_flow_code@,@userid@,@works_flow_detail_id@,@userid@,@UserName,@FullName,@time_id@,'begin' |
| | | #${sheet}` |
| | | from #${sheet}` |
| | | } else { |
| | | _value = value |
| | | } |
| | |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {window.GLOB.process && card.intertype === 'system' ? <Col span={8}> |
| | | <Form.Item label="工作流"> |
| | | <Form.Item label={ |
| | | <Tooltip placement="bottomLeft" title="导入Excel工作流仅支持发起流程。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 工作流 |
| | | </Tooltip> |
| | | }> |
| | | <Radio.Group value={verify.workFlow} onChange={(e) => {this.onOptionChange(e.target.value, 'workFlow')}}> |
| | | <Radio value="true">开启</Radio> |
| | | <Radio value="false">不开启</Radio> |
| | |
| | | /* 工作流默认sql */ |
| | | insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) |
| | | select jskey,@works_flow_code@,@works_flow_name@,@works_flow_param@,@status@,@statusname@,@work_group@,@works_flow_detail_id@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@ |
| | | #${sheet} |
| | | from #${sheet} |
| | | |
| | | 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,bid,createuserid,CreateUser,CreateStaff,upid) |
| | | select jskey,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@ |
| | | #${sheet} |
| | | from #${sheet} |
| | | |
| | | insert into s_my_works_flow_notice (works_flow_id,works_flow_code,works_flow_detail_id,userid,notice_type,createuserid,CreateUser,CreateStaff,upid) |
| | | select jskey,@works_flow_code@,@works_flow_detail_id@,@userid@,@start_type@,@userid@,@UserName,@FullName,@time_id@ |
| | | #${sheet} |
| | | from #${sheet} |
| | | |
| | | insert into s_my_works_flow_role (works_flow_id,works_flow_code,userid,works_flow_detail_id,createuserid,CreateUser,CreateStaff,upid,typecharone) |
| | | select jskey,@works_flow_code@,@userid@,@works_flow_detail_id@,@userid@,@UserName,@FullName,@time_id@,'begin' |
| | | #${sheet} |
| | | from #${sheet} |
| | | ` |
| | | } |
| | | sql += ` |