Commit 7936efea authored by 熊成伟's avatar 熊成伟

debug

parent f4c459db
Pipeline #15382 passed with stages
in 55 seconds
...@@ -8,22 +8,15 @@ const Index = (props) => { ...@@ -8,22 +8,15 @@ const Index = (props) => {
return ( return (
<div className="address-box"> <div className="address-box">
<List> <List>
{data && data.length > 0 && data.map((item, index) => ( {data && data.length > 0 && data.map((item, index) => item.XM ? (
<div> <Item key={index} className="sub-checkbox" onChange={(val) => setName(item, val.target.checked)}>
<div className="sub-title"> {item.XM || ''}
{item.DEPTNAME}
</div>
{item.childrenUser && item.childrenUser.map((child, index) => (
<Item key={child.XM} className="sub-checkbox" onChange={(val) => setName(child.XM, val.target.checked)}>
{child.XM || ''}
<div className="address-user"> <div className="address-user">
<img alt="" className='smallIco mr-5' src='/img/tel.png' /> <img alt="" className='smallIco mr-5' src='/img/tel.png' />
{child.YDDH || '无'} {item.YDDH || '无'}
</div> </div>
</Item> </Item>
))} ) : <div key={index} className="sub-title">{item.DEPTNAME}</div>)}
</div>
))}
</List> </List>
</div> </div>
......
...@@ -48,14 +48,14 @@ ...@@ -48,14 +48,14 @@
content: ''; content: '';
display: block; display: block;
width: 1px; width: 1px;
min-height: 80px; min-height: 120px;
background-color: rgba(34, 192, 100, 1); background-color: rgba(34, 192, 100, 1);
} }
.auto-step-content::before{ .auto-step-content::before{
content: ''; content: '';
display: block; display: block;
width: 1px; width: 1px;
min-height: 80px; min-height: 100px;
background-color: rgba(228, 228, 228, 1); background-color: rgba(228, 228, 228, 1);
} }
...@@ -85,10 +85,10 @@ ...@@ -85,10 +85,10 @@
} }
.auto-step-content-result{ .auto-step-content-result{
margin-top: 15px;
line-height: 41px; line-height: 41px;
border-radius: 7px; border-radius: 7px;
background: rgba(0, 0, 0, 0.05); background: rgba(0, 0, 0, 0.05);
margin: 15px 10px 0;
padding: 0 15px; padding: 0 15px;
} }
......
...@@ -38,7 +38,8 @@ const Backlog = (props) => { ...@@ -38,7 +38,8 @@ const Backlog = (props) => {
setStart(false); setStart(false);
setEnd(res.rows && res.rows.length >= 10) setEnd(res.rows && res.rows.length >= 10)
let result = end && res.rows ? data.concat(res.rows) : data; let result = end && res.rows ? data.concat(res.rows) : data;
res.rows && res.rows.length >= 10 && setCurrent(1); res.rows && res.rows.length >= 10 && setCurrent(current + 1);
current > 0 && res.rows && res.rows.length === 0 && setCurrent(current - 1);
setData(result); setData(result);
setLoading(false); setLoading(false);
}); });
......
import React from 'react'; import React from 'react';
import {Modal} from 'antd-mobile' // import {Modal} from 'antd-mobile'
import './index.less'; import './index.less';
const operation = Modal.operation; // const operation = Modal.operation;
const Option = (props) => { const Option = (props) => {
const onChange = () => { const onChange = () => {
const input = document.getElementsByClassName("option-text"); const input = document.getElementsByClassName("option-text");
props.onChange(input[0].value) props.onChange(input[0].value)
}; };
const setValue = (val) => { // const setValue = (val) => {
const input = document.getElementsByClassName("option-text"); // const input = document.getElementsByClassName("option-text");
input[0].value = val // input[0].value = val
}; // };
return ( return (
<div> <div>
<div className="option-card"> <div className="option-card">
<div className="option-title"> <div className="option-title">
<div>流转意见:</div> <div>流转意见:</div>
<a {/*<a*/}
className="option-fast" {/*className="option-fast"*/}
onClick={() => operation([ {/*onClick={() => operation([*/}
{ text: '默认一', onPress: () => setValue('默认一') }, {/*{ text: '默认一', onPress: () => setValue('默认一') },*/}
{ text: '默认二', onPress: () => setValue('默认二') }, {/*{ text: '默认二', onPress: () => setValue('默认二') },*/}
])} {/*])}*/}
> {/*>*/}
常用阅办意见<img alt="" src="/img/option-icon.png" className="option-icon"/> {/*常用阅办意见<img alt="" src="/img/option-icon.png" className="option-icon"/>*/}
</a> {/*</a>*/}
</div> </div>
<textarea className="option-text" onChange={onChange}/> <textarea className="option-text" onChange={onChange}/>
</div> </div>
......
import React, {useState, useEffect} from 'react'; import React, {useState, useEffect} from 'react';
import Document from 'react-document-title' import Document from 'react-document-title'
import {WingBlank, WhiteSpace, ActionSheet} from 'antd-mobile' import {WingBlank, WhiteSpace, ActionSheet, Toast} from 'antd-mobile'
import axiosRequest from '../../utils/request'; import axiosRequest from '../../utils/request';
import TopTabs from '../../components/BlankTabs' import TopTabs from '../../components/BlankTabs'
import Skeleton from '../../components/Skeleton' import Skeleton from '../../components/Skeleton'
...@@ -17,7 +17,10 @@ const Process = (props) => { ...@@ -17,7 +17,10 @@ const Process = (props) => {
const [templateId, setTemplateId] = useState(); const [templateId, setTemplateId] = useState();
const [tableId, setTableId] = useState(); const [tableId, setTableId] = useState();
const [nodeId, setNodeId] = useState(); const [nodeId, setNodeId] = useState();
const [operateId, setOperateId] = useState() const [operateId, setOperateId] = useState();
const [flowTbId, setFlowTbId] = useState();
console.log(operateId)
//回到顶部 //回到顶部
useEffect(() => { useEffect(() => {
...@@ -33,9 +36,10 @@ const Process = (props) => { ...@@ -33,9 +36,10 @@ const Process = (props) => {
const keys = res.elementList ? Object.keys(res.elementList) : [] const keys = res.elementList ? Object.keys(res.elementList) : []
setBasic(res.elementList ? keys.map(item => ({title: item})) : []) setBasic(res.elementList ? keys.map(item => ({title: item})) : [])
setTableId(res.table && res.table.tableId); setTableId(res.table && res.table.tableId);
setTemplateId(res.property && res.property.templateId) setTemplateId(res.property && res.property.templateId);
setNodeId(res.property && res.property.curNodeId) setNodeId(res.property && res.property.curNodeId);
setOperateId(res.property && res.property.operateId) setOperateId(res.property && res.property.operateId);
setFlowTbId(res.property && res.property.flowTbId);
}); });
}, []); }, []);
...@@ -90,7 +94,7 @@ const Process = (props) => { ...@@ -90,7 +94,7 @@ const Process = (props) => {
url: `/idtAppServiceV6/oApp/nextNodeList`, url: `/idtAppServiceV6/oApp/nextNodeList`,
body: {curNodeId: nodeId} body: {curNodeId: nodeId}
}).then(res => { }).then(res => {
const result = res ? res.map(item => ({button: item.name, target: item.special})) : [] const result = res ? res.map(item => ({button: item.name, target: item.special, nodetype: item.nodetype})) : []
setButton(result) setButton(result)
}); });
}; };
...@@ -119,7 +123,8 @@ const Process = (props) => { ...@@ -119,7 +123,8 @@ const Process = (props) => {
} }
}, [basic]); }, [basic]);
const [blyj, setBlyj] = useState() const [blyj, setBlyj] = useState();
console.log(blyj)
const optionChange = val => { const optionChange = val => {
setBlyj(val) setBlyj(val)
setDisabled(!(val != null && val !== '')) setDisabled(!(val != null && val !== ''))
...@@ -130,9 +135,8 @@ const Process = (props) => { ...@@ -130,9 +135,8 @@ const Process = (props) => {
//点击输入框, 聚焦移动 //点击输入框, 聚焦移动
const textClick = () => { const textClick = () => {
const top = document.getElementById(`event-option`).offsetTop;
document.getElementById("event").scrollTo(0,top)
document.getElementsByClassName("option-text")[0].focus(); document.getElementsByClassName("option-text")[0].focus();
window.scrollTo(0, document.body.scrollHeight);
optionBlur() optionBlur()
}; };
...@@ -141,8 +145,7 @@ const Process = (props) => { ...@@ -141,8 +145,7 @@ const Process = (props) => {
setCurrent(name) setCurrent(name)
name === 'option' && document.getElementsByClassName("option-text")[0].focus(); name === 'option' && document.getElementsByClassName("option-text")[0].focus();
name === 'option' && optionBlur() name === 'option' && optionBlur()
const top = document.getElementById(`event-${name}`).offsetTop; const top = document.getElementById(`event-${name}`).offsetTop - document.getElementById(`event-basic`).offsetTop;
console.log(top)
window.scrollTo(0,top); window.scrollTo(0,top);
}; };
...@@ -156,25 +159,8 @@ const Process = (props) => { ...@@ -156,25 +159,8 @@ const Process = (props) => {
}; };
}; };
const beforeSubmit = () => {
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/save`,
body: {
tableId,
templateId,
dealInfo: {"BLYJ": blyj},
params: {uuid},
curNodeId: nodeId,
operateId
}
}).then(res => {
console.log(res)
});
}
const showActionSheet = () => { const showActionSheet = () => {
const BUTTON = [] const BUTTON = [];
button.map(item => BUTTON.push(item.button)); button.map(item => BUTTON.push(item.button));
const BUTTONS = BUTTON.concat(['取消']); const BUTTONS = BUTTON.concat(['取消']);
ActionSheet.showActionSheetWithOptions({ ActionSheet.showActionSheetWithOptions({
...@@ -189,31 +175,54 @@ const Process = (props) => { ...@@ -189,31 +175,54 @@ const Process = (props) => {
}); });
}; };
const subUrl = key => { const subUrl = key => {
beforeSubmit() button[key].nodetype === 'bakup' ? end() :
// const url = button[key].target; props.history.push(`/blank/submit/${nodeId}/${uuid}/${flowTbId ? flowTbId : 'null'}`)
// props.history.push(`/blank/submit/${url}`) };
const end = () => {
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/application/interfaces/flow/saveWorkFlowModel.jsp`,
body: {
flowNodeId: nodeId,
attachId: uuid,
flowTbId: flowTbId === 'null' ? '' : flowTbId,
userListMap: JSON.stringify([{}])
}
}).then(res => {
if (res.success === 'success') {
Toast.success("操作成功", 1, () => {
props.history.push('/bord/backlog')
});
}
});
} }
const handleScroll = () => { const handleScroll = () => {
// const adjunct = document.getElementById("event-adjunct").offsetTop; const basic = document.getElementById("event-basic").offsetTop;
// const flow = document.getElementById("event-flow").offsetTop; const adjunct = document.getElementById("event-adjunct").offsetTop;
// const option = document.getElementById("event-option").offsetTop; const flow = document.getElementById("event-flow").offsetTop;
// const event = document.getElementById('event'); const option = document.getElementById("event-option").offsetTop;
// const top = event.scrollTop; const top = document.documentElement.scrollTop || document.body.scrollTop;
// const scrollHeight = event.scrollHeight; let clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
// const clientHeight = event.clientHeight let scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
// if (top >= 0 && top < adjunct) { console.log(top)
// setCurrent('basic') if (top >= basic && top < adjunct) {
// }else if (top >= adjunct && top < flow) { console.log('basic');
// setCurrent('adjunct') setCurrent('basic')
// }else if (top >= flow && top < option) { }else if (top >= adjunct - basic && top < flow) {
// setCurrent('flow') console.log('adjunct');
// }else if (top >= option) { setCurrent('adjunct')
// setCurrent('option') }else if (top >= flow - basic && top < option) {
// } console.log('flow');
// if (top + clientHeight === scrollHeight) { setCurrent('flow')
// setCurrent('option') }else if (top >= option - basic) {
// } console.log('option');
setCurrent('option')
}
if (top + clientHeight === scrollHeight) {
setCurrent('option')
}
}; };
useEffect(() => { useEffect(() => {
window.addEventListener('scroll', handleScroll, true); window.addEventListener('scroll', handleScroll, true);
...@@ -240,13 +249,16 @@ const Process = (props) => { ...@@ -240,13 +249,16 @@ const Process = (props) => {
{basicLoading ? <Option onChange={optionChange}/> : <Skeleton/>} {basicLoading ? <Option onChange={optionChange}/> : <Skeleton/>}
</WingBlank> </WingBlank>
</div> </div>
<div className="event-footer"> <div className="event-footer">
{(basicLoading && adjunctLoading && flowLoading && basicLoading) && (
<div className={`event-footer-button ${(footStatus && disabled) ? 'button-disabled' : '' }`} onClick={footStatus && !disabled ? showActionSheet: textClick}> <div className={`event-footer-button ${(footStatus && disabled) ? 'button-disabled' : '' }`} onClick={footStatus && !disabled ? showActionSheet: textClick}>
{!footStatus && ( {!footStatus && (
<img alt="" src="/img/process-edit.png" className="process-edit"/> <img alt="" src="/img/process-edit.png" className="process-edit"/>
)} )}
{footButton} {footButton}
</div> </div>
)}
</div> </div>
......
import React, {useEffect, useState} from 'react'; import React, {useEffect, useState} from 'react';
// import {WingBlank, WhiteSpace, ActivityIndicator} from "antd-mobile"; import Skeleton from '../../components/Skeleton'
import axiosRequest from '../../utils/request'; import axiosRequest from '../../utils/request';
import AddressCheckbox from '../../components/AddressList/AddressCheckbox'; import AddressCheckbox from '../../components/AddressList/AddressCheckbox';
import {WingBlank, WhiteSpace, Toast} from "antd-mobile";
const SubmitDetail = (props) => { const SubmitDetail = (props) => {
const {flowNodeId, uuid, flowTbId} = props.match.params;
const [data, setData] = useState([]); const [data, setData] = useState([]);
// const [title, setTitle] = useState([]); const [loading, setLoading] = useState(false);
const [disabled, setDisabled] = useState(true); const [disabled, setDisabled] = useState(true);
useEffect(() => { useEffect(() => {
const {type} = props.match.params
setLoading(true)
axiosRequest({ axiosRequest({
method: 'post', method: 'post',
url: `/idtAppServiceV6/oApp/getLeaders?nType=${type}`, url: `/idtAppServiceV6/application/interfaces/flow/getFlowJs.jsp?flowNodeId=${flowNodeId}`,
}).then(res => { }).then(res => {
setLoading(false)
setData(res) setData(res)
}); });
...@@ -21,16 +26,34 @@ const SubmitDetail = (props) => { ...@@ -21,16 +26,34 @@ const SubmitDetail = (props) => {
const [suData, setSuData] = useState([]) const [suData, setSuData] = useState([])
const checkName = (name, checked) => { const checkName = (name, checked) => {
const newData = [...suData]; const newData = [...suData];
const index = newData.indexOf(name); const index = newData.findIndex(item => item.XM === name.XM);
checked ? newData.push(name) : newData.splice(index, 1); checked ? newData.push({XM: name.XM, XMPY: name.XMPY}) : newData.splice(index, 1);
newData.length > 0 ? setDisabled(false) : setDisabled(true) newData.length > 0 ? setDisabled(false) : setDisabled(true)
setSuData(newData) setSuData(newData)
} }
const textClick = () => { const textClick = () => {
console.log(suData) axiosRequest({
method: 'post',
url: `/idtAppServiceV6/application/interfaces/flow/saveWorkFlowModel.jsp`,
body: {
flowNodeId,
attachId: uuid,
flowTbId: flowTbId === 'null' ? '' : flowTbId,
userListMap: JSON.stringify(suData)
}
}).then(res => {
if (res.success === 'success') {
Toast.success("操作成功", 1, () => {
props.history.push('/bord/backlog')
});
}
});
} }
return ( return (
<div>
{loading ? <WingBlank><WhiteSpace/><Skeleton/></WingBlank> : (
<div> <div>
<div className='adMainBox'> <div className='adMainBox'>
<AddressCheckbox data={data} setName={checkName}/> <AddressCheckbox data={data} setName={checkName}/>
...@@ -42,6 +65,9 @@ const SubmitDetail = (props) => { ...@@ -42,6 +65,9 @@ const SubmitDetail = (props) => {
</div> </div>
</div> </div>
)}
</div>
); );
}; };
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
.event-footer{ .event-footer{
height: 45px; height: 45px;
position: fixed; position: fixed;
bottom: 0; left: 0; right: 0 bottom: 0; left: 0; right: 0;
z-index: 10;
} }
.event-footer-button{ .event-footer-button{
width: 100%; width: 100%;
......
...@@ -31,9 +31,8 @@ const Notice = (props) => { ...@@ -31,9 +31,8 @@ const Notice = (props) => {
setStart(false); setStart(false);
setEnd(res.rows && res.rows.length >= 10) setEnd(res.rows && res.rows.length >= 10)
let result = end && res.rows ? data.concat(res.rows) : data; let result = end && res.rows ? data.concat(res.rows) : data;
res.rows && res.rows.length >= 10 && setCurrent(current + 1);
console.log('end', end, 'result',result, 'res', res) current > 0 && res.rows && res.rows.length === 0 && setCurrent(current - 1);
res.rows && res.rows.length >= 10 && setCurrent(1);
setData(result); setData(result);
setLoading(false); setLoading(false);
}); });
......
...@@ -32,7 +32,7 @@ const ReactRouter = () => { ...@@ -32,7 +32,7 @@ const ReactRouter = () => {
<Route path="/blank" component={() => <Route path="/blank" component={() =>
<BlankLayout> <BlankLayout>
<Route path="/blank/work/:type" component={WorkDetail}/> <Route path="/blank/work/:type" component={WorkDetail}/>
<Route path="/blank/submit/:type" component={SubmitDetail}/> <Route path="/blank/submit/:flowNodeId/:uuid/:flowTbId" component={SubmitDetail}/>
<Route path="/blank/info/:id/:uuid" component={Process}/> <Route path="/blank/info/:id/:uuid" component={Process}/>
</BlankLayout> </BlankLayout>
}/> }/>
......
...@@ -48,13 +48,15 @@ export const createAPI = (baseURL) => { ...@@ -48,13 +48,15 @@ export const createAPI = (baseURL) => {
headers, headers,
})) }))
.then(function (response) { .then(function (response) {
response = response.data; response = response.data || response.tree;
// console.log(response)
if (!response || !response.data) { // console.log(!response || !(response.data || response.tree))
if (!response || !(response.data || response.tree)) {
// response.status === 'failure' && (window.location.href = '/login') // response.status === 'failure' && (window.location.href = '/login')
response.code === 'idt-core-501' && (window.location.href = '/login') response.message === '票据已经失效' && (window.location.href = '/login')
console.log('response出错, 无返回数据!', response); return false; console.log('response出错, 无返回数据!', response);
// return false;
}; };
if (response.data && response.data.errorMessage) { if (response.data && response.data.errorMessage) {
Toast.fail(response.data.errorMessage); Toast.fail(response.data.errorMessage);
...@@ -73,8 +75,8 @@ export const createAPI = (baseURL) => { ...@@ -73,8 +75,8 @@ export const createAPI = (baseURL) => {
menu.length > 0 && localStorage.setItem("menu", JSON.stringify(menu)); menu.length > 0 && localStorage.setItem("menu", JSON.stringify(menu));
} }
if (response.data) { if (response.data || response.tree || response.success) {
return response.data; return response.data ? response.data : (response.tree ? response.tree : response);
} else { } else {
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment