Commit 56f498de authored by 熊成伟's avatar 熊成伟

debug

parent 1caac495
Pipeline #15265 failed with stages
in 31 seconds
This diff is collapsed.
...@@ -11,7 +11,7 @@ const tabs = [ ...@@ -11,7 +11,7 @@ const tabs = [
const Index = (props) => { const Index = (props) => {
return ( return (
<div> <div className="blank-tab-card">
<Tabs <Tabs
page={props.page} page={props.page}
tabs={tabs} tabs={tabs}
......
.blank-tab-card{
position: fixed;
width: 100%;
top: 0;
}
.am-tabs-default-bar-tab-active{ .am-tabs-default-bar-tab-active{
color: #0185FB; color: #0185FB;
} }
......
...@@ -13,6 +13,12 @@ const Process = (props) => { ...@@ -13,6 +13,12 @@ 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();
//回到顶部
useEffect(() => {
window.scrollTo(0, 0)
}, []);
useEffect(() => { useEffect(() => {
const {id} = props.match.params const {id} = props.match.params
axiosRequest({ axiosRequest({
...@@ -66,7 +72,7 @@ const Process = (props) => { ...@@ -66,7 +72,7 @@ const Process = (props) => {
setAdjunctData(res) setAdjunctData(res)
}); });
}; };
// const [button, setButton] = useState({}) const [button, setButton] = useState([])
const getButton= uuid => { const getButton= uuid => {
axiosRequest({ axiosRequest({
method: 'post', method: 'post',
...@@ -74,7 +80,7 @@ const Process = (props) => { ...@@ -74,7 +80,7 @@ const Process = (props) => {
body: {curNodeId: nodeId} body: {curNodeId: nodeId}
}).then(res => { }).then(res => {
console.log(res) console.log(res)
// setAdjunctData(res) setButton(res)
}); });
}; };
useEffect(() => { useEffect(() => {
...@@ -124,7 +130,8 @@ const Process = (props) => { ...@@ -124,7 +130,8 @@ const Process = (props) => {
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").scrollTo(0,top); console.log(top)
window.scrollTo(0,top);
}; };
...@@ -137,6 +144,8 @@ const Process = (props) => { ...@@ -137,6 +144,8 @@ const Process = (props) => {
}; };
} }
const showActionSheet = () => { const showActionSheet = () => {
// const but = button.map(item => (`${item.showname}`));
// console.log(but)
const BUTTONS = ['送部门领导审核', '送办公室分管主任审批', '办结', '取消']; const BUTTONS = ['送部门领导审核', '送办公室分管主任审批', '办结', '取消'];
ActionSheet.showActionSheetWithOptions({ ActionSheet.showActionSheetWithOptions({
options: BUTTONS, options: BUTTONS,
...@@ -155,35 +164,32 @@ const Process = (props) => { ...@@ -155,35 +164,32 @@ const Process = (props) => {
} }
const handleScroll = () => { const handleScroll = () => {
const adjunct = document.getElementById("event-adjunct").offsetTop; // const adjunct = document.getElementById("event-adjunct").offsetTop;
const flow = document.getElementById("event-flow").offsetTop; // const flow = document.getElementById("event-flow").offsetTop;
const option = document.getElementById("event-option").offsetTop; // const option = document.getElementById("event-option").offsetTop;
const event = document.getElementById('event'); // const event = document.getElementById('event');
const top = event.scrollTop; // const top = event.scrollTop;
const scrollHeight = event.scrollHeight; // const scrollHeight = event.scrollHeight;
const clientHeight = event.clientHeight // const clientHeight = event.clientHeight
if (top >= 0 && top < adjunct) { // if (top >= 0 && top < adjunct) {
setCurrent('basic') // setCurrent('basic')
}else if (top >= adjunct && top < flow) { // }else if (top >= adjunct && top < flow) {
setCurrent('adjunct') // setCurrent('adjunct')
}else if (top >= flow && top < option) { // }else if (top >= flow && top < option) {
setCurrent('flow') // setCurrent('flow')
}else if (top >= option) { // }else if (top >= option) {
setCurrent('option') // setCurrent('option')
} // }
if (top + clientHeight === scrollHeight) { // if (top + clientHeight === scrollHeight) {
setCurrent('option') // setCurrent('option')
} // }
}; };
useEffect(() => { useEffect(() => {
window.addEventListener('scroll', handleScroll, true); window.addEventListener('scroll', handleScroll, true);
return () => window.removeEventListener('scroll', handleScroll, true); return () => window.removeEventListener('scroll', handleScroll, true);
}, []); }, []);
//回到顶部
useEffect(() => {
window.scrollTo(0, 0)
}, []);
return ( return (
<Document title="待办详情"> <Document title="待办详情">
<div> <div>
......
@import '../../variable.less'; @import '../../variable.less';
#event{ #event{
//position: fixed;
//top: 44px;
//left: 0;right: 0; bottom: 50px;
//overflow: auto;
margin-top: 48px;
margin-bottom: 50px; margin-bottom: 50px;
padding-bottom: 340px; padding-bottom: 340px;
} }
......
...@@ -66,8 +66,8 @@ const Notice = (props) => { ...@@ -66,8 +66,8 @@ const Notice = (props) => {
return () => window.removeEventListener('touchmove', handleScroll, true); return () => window.removeEventListener('touchmove', handleScroll, true);
}, [data]); }, [data]);
const checkLog = () => { const checkLog = (OPERATEID, UUID) => {
props.history.push(`/blank/info/example/1`) props.history.push(`/blank/info/${OPERATEID}/${UUID}`)
}; };
//回到顶部 //回到顶部
...@@ -115,7 +115,7 @@ const Notice = (props) => { ...@@ -115,7 +115,7 @@ const Notice = (props) => {
data.length > 0 ? data.map((item, index) => ( data.length > 0 ? data.map((item, index) => (
<div key={index}> <div key={index}>
<WhiteSpace/> <WhiteSpace/>
<TodoCard data={item} onClick={checkLog}/> <TodoCard data={item} onClick={() => checkLog(item.OPERATEID, item.UUID)}/>
</div> </div>
)) : <Empty/> )) : <Empty/>
......
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