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