From 0f6c07ed2f8dddd3ad6e37268bf06df6d82961ed Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 24 五月 2024 17:57:30 +0800 Subject: [PATCH] 2024-05-24 --- src/menu/modalconfig/formfork/index.scss | 77 +++++++++++++++ src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx | 8 src/menu/debug/index.jsx | 8 src/menu/modalconfig/formfork/index.jsx | 186 ++++++++++++++++++++++++++++++++++--- src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx | 7 + src/utils/utils.js | 8 6 files changed, 265 insertions(+), 29 deletions(-) diff --git a/src/menu/debug/index.jsx b/src/menu/debug/index.jsx index cfc99cf..c40298c 100644 --- a/src/menu/debug/index.jsx +++ b/src/menu/debug/index.jsx @@ -1588,19 +1588,19 @@ /* 宸ヤ綔娴侀粯璁ql */ 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} ` } diff --git a/src/menu/modalconfig/formfork/index.jsx b/src/menu/modalconfig/formfork/index.jsx index 0a37edd..30a865c 100644 --- a/src/menu/modalconfig/formfork/index.jsx +++ b/src/menu/modalconfig/formfork/index.jsx @@ -1,7 +1,7 @@ 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' @@ -13,6 +13,15 @@ state = { visible: false, + empty: false, + ctrlFields: [], + ctrlRFields: [], + subFields: [], + subRFields: [], + linkFields: [], + tabFields: [], + type: '', + forward: 'true', } shouldComponentUpdate (nextProps, nextState) { @@ -21,12 +30,6 @@ trigger = () => { const { forms } = this.props - - // let linkSubField = [] - // let supField = [] - // let tabField = [] - // let linkField = [] - let linkFields = {} // 鍏宠仈鑿滃崟 let controlFields = {} // 鎺у埗琛ㄥ崟 @@ -48,7 +51,7 @@ } 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 @@ -159,7 +162,9 @@ } else { item.tabLabel = fieldMap.get(item.tabField).label } - } + } else { + delete item.tabField + } } else { delete item.tabField } @@ -184,8 +189,6 @@ delete item.multiple delete item.linkSubField - // if (!item.controlFields && !item.linkFields && !item.subFields && !item.resubFields) - fieldMap.set(item.field, item) }) @@ -208,30 +211,181 @@ }) } }) - + + 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">姝e悜</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> </> ) diff --git a/src/menu/modalconfig/formfork/index.scss b/src/menu/modalconfig/formfork/index.scss index 43f399e..c4ba75d 100644 --- a/src/menu/modalconfig/formfork/index.scss +++ b/src/menu/modalconfig/formfork/index.scss @@ -4,6 +4,83 @@ } .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 { diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx index 1251514..ab01815 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx @@ -250,19 +250,19 @@ _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 } diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx index 1e1288b..be7041f 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx @@ -1038,7 +1038,12 @@ </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> diff --git a/src/utils/utils.js b/src/utils/utils.js index 3f46caf..1fa8b28 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -1287,19 +1287,19 @@ /* 宸ヤ綔娴侀粯璁ql */ 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 += ` -- Gitblit v1.8.0