Commit 1caac495 authored by 熊成伟's avatar 熊成伟

debug

parent ba62a90d
Pipeline #15264 passed with stages
in 55 seconds
This diff is collapsed.
public/img/test/test-2.png

26.1 KB | W: | H:

public/img/test/test-2.png

25.1 KB | W: | H:

public/img/test/test-2.png
public/img/test/test-2.png
public/img/test/test-2.png
public/img/test/test-2.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -8,17 +8,24 @@ const Index = (props) => {
return (
<div className="address-box">
<List>
{data && data.length > 0 && data.map((item, index) => item.XM && (
<Item key={item.XM} className="sub-checkbox" onChange={(val) => setName(item.XM, val.target.checked)}>
<div>
<img alt="" src="" className=""/>
{item.XM || ''}
</div>
<div className="address-user">
<img alt="" className='smallIco mr-5' src='/img/tel.png' />
{item.YDDH || '无'}
</div>
</Item>
{data && data.length > 0 && data.map((item, index) => (
<div>
<div className="sub-title">
{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)}>
<div>
<img alt="" src="" className=""/>
{child.XM || ''}
</div>
<div className="address-user">
<img alt="" className='smallIco mr-5' src='/img/tel.png' />
{child.YDDH || '无'}
</div>
</Item>
))}
</div>
))}
</List>
......
......@@ -19,3 +19,7 @@
.address-phone{
color: rgba(0, 0, 0, 1) !important;
}
.sub-title{
padding: 10px;
border-bottom: 1px solid rgba(239, 239, 239, 1);
}
......@@ -16,16 +16,16 @@ class Index extends PureComponent {
this.visibleChange(false)
}
render() {
const {type} = this.props;
const {type, data} = this.props;
const {visible} = this.state
return (
<div className={`adjunct-card ${type ? 'adjunct-word' : 'adjunct-pdf'}`}>
<div className="adjunct-title">
<img alt="" src={type ? '/img/test/test-2.png' : '/img/test/test.png'} className="adjunct-img"/>
<div>
<p className="adjunct-title-1">武汉考察注意政策</p>
<p className="adjunct-title-2">科技创新委员会</p>
<div className="adjunct-content">
<p className="adjunct-title-1">{data.FILENAME}</p>
<p className="adjunct-title-2">{data.DEPTNAME}</p>
</div>
</div>
<Popover
......
......@@ -16,6 +16,7 @@
.adjunct-title{
display: flex;
justify-content: flex-start;
align-items: center;
}
.adjunct-img{
width: 33px;
......@@ -32,3 +33,7 @@
font-size:11px;
color:rgba(152,152,152,1);
}
.adjunct-content{
flex: 1;
//width: 240px;
}
......@@ -4,16 +4,13 @@ import './index.less'
const Index = (props) => {
return (
<div className="auto-list-card">
{props.title && (
<div className="auto-list-item auto-list-item-title">{props.title}</div>
)}
{props.listData.map((item, index) => (
{props.listData && props.listData.map((item, index) => (
<div key={index} className={`auto-list-item ${item.line ? 'auto-list-item-line-feed' : 'auto-list-item-line'}`}>
<div className="auto-list-title">
{item.title}
</div>
<div className="auto-list-content">
{item.content}
{item.content || ''}
</div>
</div>
))}
......
......@@ -15,7 +15,8 @@
padding: 5px 15px;
min-height: 43px;
background: #ffffff;
margin-bottom: 1px;
border-bottom: 1px solid rgba(248, 248, 248, 1);
//margin-bottom: 1px !important;
}
.auto-list-card > .auto-list-item:first-child{
border-radius: 6px 6px 0 0;
......@@ -35,7 +36,7 @@
min-width: 100px;
}
.auto-list-content{
padding: 10px 18px;
padding: 10px 0;
font-size: 14px;
line-height: 22px;
}
import React from 'react';
import './index.less'
const data = [{}, {}, {}, {s: '1'}, {s: '111', result: '11111'}]
const Index = (props) => {
const {data} = props
return (
<div className="auto-step">
<ul className="auto-step-card">
{
data.map((item, index) => (
<li className="auto-step-item" key={index}>
<div className={`auto-step-item-title ${item.s ? 'step-current' : 'step-success'}`}>
<div className="auto-step-item-title-name">发起申请(拟稿)</div>
<div className={`auto-step-item-title ${index === data.length -1 ? 'step-current' : 'step-success'}`}>
<div className="auto-step-item-title-name">{item.FLOW_ALIASED}</div>
</div>
<div className={`auto-step-content ${item.s ? '' : 'step-success'}`}>
<div className="step-content-wrapper">
<div className="auto-step-content-flow">
<div className="auto-step-content-head">
<img src="/img/test/test-2.png" alt="" className="step-content-head-img"/>
<span>赵依安</span>
<span>{item.FROMUSER_ALIASED}</span>
</div>
<span>2020-04-09 08:44:36</span>
<div className="pos-center">{item.SENDDATE}</div>
</div>
{item.result && (
<div className="auto-step-content-result">
......
......@@ -48,14 +48,14 @@
content: '';
display: block;
width: 1px;
min-height: 90px;
min-height: 80px;
background-color: rgba(34, 192, 100, 1);
}
.auto-step-content::before{
content: '';
display: block;
width: 1px;
min-height: 90px;
min-height: 80px;
background-color: rgba(228, 228, 228, 1);
}
......@@ -76,7 +76,7 @@
}
.auto-step-content-head{
display: flex;
align-items: flex-start;
align-items: center;
}
.step-content-head-img{
width: 30px;
......@@ -92,4 +92,7 @@
padding: 0 15px;
}
.pos-center{
display: flex;
align-items: center;
}
import React, {useState, useEffect} from 'react';
import './index.less'
const CardItem = (props) => {
const {data, addStatus, type, addCommon, iconAction, workUrl} = props;
......
......@@ -11,8 +11,6 @@ body {
html,
body,
#root {
position: fixed;
top: 0; left: 0;right: 0; bottom: 0;
width: 100%;
height: 100%;
margin: 0;
......
......@@ -6,21 +6,20 @@ import './index.less'
const CommonLayout = (props) => {
const resize = (defaultH) => {
const scrollHeight = document.body.scrollHeight;
const innerHeight = window.innerHeight;
const footer = document.getElementById("footer");
const content = document.getElementById("common-content")
if (footer) {
if (defaultH > scrollHeight) {
if (defaultH > innerHeight) {
footer.classList.remove('footer');
footer.classList.add('footer-static')
}else {
footer.classList.add('footer')
footer.classList.remove('footer-static');
}
}
if (content) {
if (defaultH > scrollHeight) {
if (defaultH > innerHeight) {
content.classList.remove('common-layout-content');
content.classList.add('common-layout-content-static');
}else {
......@@ -33,17 +32,16 @@ const CommonLayout = (props) => {
};
useEffect(() => {
const defaultH = document.body.scrollHeight;
const defaultH = window.innerHeight;
window.addEventListener('resize', () => resize(defaultH));
return () => window.removeEventListener('resize', resize);
}, [])
return (
<div>
<div id="common-content" className="common-layout-content">
<div id="common-content" className="common-layout-content" >
<div>
{props.children}
</div>
</div>
<Footer {...props}/>
</div>
......
.common-layout-content{
position: fixed;
top: 0;left: 0;right: 0;bottom: 50px;
overflow: auto;
padding-bottom: 10px
padding-bottom: 10px;
margin-bottom: 50px;
}
.common-layout-content-static{
position: fixed;
top: 0;left: 0;right: 0;bottom: 10px;
overflow: auto;
padding-bottom: 10px;
margin-bottom: 10px;
}
.footer-tab-icon{
......
import React, {useState, useEffect} from 'react';
import {WhiteSpace, WingBlank, ActivityIndicator, Toast} from 'antd-mobile'
import {WhiteSpace, WingBlank, ActivityIndicator} from 'antd-mobile'
import TodoCard from '../../components/LogCard'
import TopSearch from '../../components/TopSearch';
import axiosRequest from '../../utils/request';
import Document from 'react-document-title'
import Empty from '../Empty'
import useDebounce from '../../useHooks/useDebounce'
const Backlog = (props) => {
const [start, setStart] = useState(true);
const [endT, setEndT] = useState(false);
const [t, setT] = useState(false)
useEffect(() => {
setT(true)
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/getUnDone',
body: {nowPage: 1, pageSize: 10},
}).then(res => {
setT(false);
setStart(false)
let result = end && res.rows ? data.concat(res.rows) : data;
res.rows && res.rows.length >= 10 && setCurrent(1);
setEnd(res.rows && res.rows.length >= 10)
setData(result);
});
}, [])
const [current, setCurrent] = useState(0);
const [searchWord, setSearchWord] = useState()
const [searchWord, setSearchWord] = useState();
const [loading, setLoading] = useState(false);
......@@ -28,7 +46,7 @@ const Backlog = (props) => {
}).then(res => {
setLoading(false);
let result = end && res.rows ? data.concat(res.rows) : data;
res.rows && res.rows.length >= 10 ? setCurrent(current + 1) : Toast.info('当前是最后一页', 1);
res.rows && res.rows.length >= 10 ? setCurrent(current + 1) : setEndT(true);
setEnd(res.rows && res.rows.length >= 10)
setData(result);
});
......@@ -36,24 +54,24 @@ const Backlog = (props) => {
//下拉加载
const [end, setEnd] = useState(true);
const handleScroll = useDebounce(() => {
const event = document.getElementById("common-content")
const top = event.scrollTop;
const scrollHeight = event.scrollHeight;
const clientHeight = event.clientHeight;
if (top + clientHeight === scrollHeight) {
const handleScroll =() => {
let scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
let clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
let scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
console.log(scrollTop, scrollHeight, clientHeight, scrollTop + clientHeight === scrollHeight)
if(scrollHeight > clientHeight && scrollTop + clientHeight === scrollHeight) {
getData()
}
}, 500)
}
useEffect(() => {
window.addEventListener('scroll', handleScroll, true);
return () => window.removeEventListener('scroll', handleScroll, true);
window.addEventListener('touchmove', handleScroll, true);
return () => window.removeEventListener('touchmove', handleScroll, true);
}, [data]);
//回到顶部
useEffect(() => {
const element = document.getElementById('common-content')
element.scrollTo(0, 0)
window.scrollTo(0, 0)
}, [])
const wordSearch = val => {
......@@ -61,28 +79,40 @@ const Backlog = (props) => {
getData()
};
useEffect(() => {
getData()
!start && getData()
}, [searchWord]);
console.log(loading)
return (
<Document title="待办">
<WingBlank>
<ActivityIndicator
toast
text="加载中..."
animating={loading}
animating={t}
/>
<WhiteSpace/>
<TopSearch onSearch={wordSearch}/>
{
data.length > 0 ? data.map((item, index) => (
<div key={index}>
<WhiteSpace/>
<TodoCard data={item} onClick={() => checkLog(item.OPERATEID, item.UUID)}/>
</div>
!start && (
data.length > 0 ? data.map((item, index) => (
<div key={index}>
<WhiteSpace/>
<TodoCard data={item} onClick={() => checkLog(item.OPERATEID, item.UUID)}/>
</div>
)) : <Empty/>
)
)) : <Empty/>
}
<WhiteSpace/>
{loading && endT && (
<div className="pos-line mb-10">
<ActivityIndicator/>
<WhiteSpace/>
</div>
)}
</WingBlank>
</Document>
);
......
......@@ -8,6 +8,7 @@ import Empty from '../Empty'
const AddressBook = (props) => {
const [start, setStart] = useState(true);
const [loading, setLoading] = useState(false);
const [data, setData] = useState([]);
// const [type, setType] = useState('basic')
......@@ -22,6 +23,7 @@ const AddressBook = (props) => {
method: 'post',
url: '/idtAppServiceV6/oApp/getDeptTree',
}).then(res => {
setStart(false)
setLoading(false);
setData(res)
});
......@@ -42,9 +44,9 @@ const AddressBook = (props) => {
animating={loading}
/>
<div className='adMainBox'>
{data.length > 0 ? (
{ !start && ( data.length > 0 ? (
<AddressList data={data} onCLick={treeClick}/>
): <Empty/>}
): <Empty/>)}
</div>
</div>
......
......@@ -7,6 +7,7 @@ import Empty from '../Empty'
const Communicate = (props) => {
const [start, setStart] = useState(true);
const [loading, setLoading] = useState(false);
const [data, setData] = useState([]);
const [title, setTitle] = useState([])
......@@ -18,6 +19,7 @@ const Communicate = (props) => {
url: `/idtAppServiceV6/oApp/getSearchAddressBook?deptId=${id}`,
}).then(res => {
setLoading(false);
setStart(false)
setData(res.userList)
setTitle(res.deptList)
});
......@@ -40,7 +42,7 @@ const Communicate = (props) => {
{title.length > 0 ? title[0].depts : ''}
</div>
<div className='adMainBox'>
{data.length > 0 ? <AddressUser data={data}/> : <Empty/>}
{ !start && (data.length > 0 ? <AddressUser data={data}/> : <Empty/>)}
</div>
</div>
......
......@@ -2,34 +2,26 @@ import React from 'react';
import List from '../../components/List'
import AdjunctList from '../../components/Adjunct'
const da222 = Array.from(new Array(7)).map((_val, i) => ({
id: `name${i}`,
text: `name${i}`,
}));
const Adjunct = (props) => {
// const [data, setData] = useState([])
const {data} = props
const listData = [
{title: '开始时间', content: '文电科'},
{title: '结束时间', content: '3'},
{title: '天数', content: ''},
{title: '乘坐交通工具', content: '武汉'},
{title: '备注', line: true, content: '函数是也是对象,是一个属性的集合,所以函数下也有属性,也可以自定义属性。当我们创建一个函数时就默认会有一个prototype属性,这个属性是一个对象(属性的集合)。这个东西就是原型---通过调用构造函数而创建的那个对象实例的原型对象。prototype里也有个属性constructor,指向的是函数本身'},
{title: '附件', line: true, content:
// {title: '开始时间', content: '文电科'},
// {title: '结束时间', content: '3'},
// {title: '天数', content: ''},
// {title: '乘坐交通工具', content: '武汉'},
{title: '附件', line: data.length > 0, content:
<div>
{da222.map((item, index) => (
<AdjunctList key={index} {...item}/>
))}
{data.length > 0 ? data.map((item, index) => (
<AdjunctList key={index} data={item}/>
)) : '无'}
</div>
},
]
return (
<div>
<List
listData={listData}
/>
<List listData={listData}/>
</div>
);
};
......
import React from 'react';
import './index.less'
import List from '../../components/List'
// import axiosRequest from '../../utils/request';
const Basic = (props) => {
const {data} = props
const personImg = data.map((item, index) => (
<div key={index} className="basic-people-item">
<img className="work-people-img" alt="" src='/img/test/test.png'/>
<div>aaa</div>
</div>
))
const listData = [
{title: '单位(科室)', content: '文电科'},
{title: '人数', content: '3'},
{title: '人员', content: <div className="basic-people-content">{personImg}</div>},
{title: '目的地', content: '武汉'},
{title: '事由', content: '考察'},
];
return (
<div>
<List
title={"6.1日,部门考察工作出差申请"}
listData={listData}
/>
<List listData={data}/>
</div>
);
};
......
import React, {useEffect} from 'react';
import React from 'react';
import StepCard from '../../components/StepCard'
// import axiosRequest from '../../utils/request';
const Flow = (props) => {
const {data} = props
// const [data, setData] = useState([])
useEffect(() => {
// const {tableId} = props;
// axiosRequest({
// method: 'post',
// url: `/dgbg/MobileGetFlowsByTabId.view?userName=2012012099&clientFlag=123456&tableId=${tableId}`,
// }).then(res => {
// console.log(res)
// setData([])
// });
}, []);
return (
<div>
<StepCard data={data}/>
......
......@@ -10,24 +10,85 @@ import Flow from './Flow';
import Option from './Option';
const Process = (props) => {
const [templateId, setTemplateId] = useState();
const [tableId, setTableId] = useState();
const [nodeId, setNodeId] = useState();
useEffect(() => {
const {id} = props.match.params
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/dispatcher?operateId=${id}`,
url: `/idtAppServiceV6/oApp/dispatcher?operateId=${id}&formType=form`,
}).then(res => {
console.log(res)
const keys = res.elementList ? Object.keys(res.elementList) : []
setBasic(res.elementList ? keys.map(item => ({title: item})) : [])
setTableId(res.table && res.table.tableId);
setTemplateId(res.property && res.property.templateId)
setNodeId(res.property && res.property.curNodeId)
});
}, [])
}, []);
//获取basic数据
const [basic, setBasic] = useState([]);
const getBasic = uuid => {
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/getData`,
body: {uuid, tableId, templateId}
}).then(res => {
const result = [...basic];
result.map(item => {
item.content = res[item.title]
return null;
});
setBasic(result)
});
}
//获取Flow数据
const [flowData, setFlowData] = useState([]);
const getFlow = uuid => {
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/getFlowList`,
body: {uuid, tableId}
}).then(res => {
setFlowData(res)
});
};
const [loading, setLoading] = useState(false);
const [adjunctData, setAdjunctData] = useState([]);
const getAdjunct= uuid => {
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/getFiles`,
body: {uuid, fieldName: 'fj', tableId}
}).then(res => {
setAdjunctData(res)
});
};
// const [button, setButton] = useState({})
const getButton= uuid => {
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/nextNodeList`,
body: {curNodeId: nodeId}
}).then(res => {
console.log(res)
// setAdjunctData(res)
});
};
useEffect(() => {
const {uuid} = props.match.params;
templateId && tableId && getBasic(uuid)
templateId && tableId && getFlow(uuid);
templateId && tableId && getAdjunct(uuid)
getButton()
}, [nodeId]);
// const [tableId, setTableId] = useState()
const [loading, setLoading] = useState(false);
//提交按钮状态
const [disabled, setDisabled] = useState(true)
const [disabled, setDisabled] = useState(true);
//提交按钮文字
const [footButton, setFootButton] = useState('确认发送');
//聚焦
......@@ -84,7 +145,7 @@ const Process = (props) => {
wrapProps,
},
(buttonIndex) => {
buttonIndex < 2 && subUrl(buttonIndex)
buttonIndex < BUTTONS.length - 1 && subUrl(buttonIndex)
console.log(buttonIndex)
});
};
......@@ -117,7 +178,12 @@ const Process = (props) => {
useEffect(() => {
window.addEventListener('scroll', handleScroll, true);
return () => window.removeEventListener('scroll', handleScroll, true);
}, [])
}, []);
//回到顶部
useEffect(() => {
window.scrollTo(0, 0)
}, []);
return (
<Document title="待办详情">
<div>
......@@ -131,13 +197,13 @@ const Process = (props) => {
<WingBlank>
<div id="event-basic"/>
<WhiteSpace/>
<Basic data={[]}/>
<Basic data={basic}/>
<div id="event-adjunct"/>
<WhiteSpace/>
<Adjunct data={[]}/>
<Adjunct data={adjunctData}/>
<div id="event-flow"/>
<WhiteSpace/>
<Flow data={[]}/>
<Flow data={flowData}/>
<div id="event-option"/>
<WhiteSpace/>
<Option onChange={optionChange}/>
......
......@@ -5,17 +5,15 @@ import AddressCheckbox from '../../components/AddressList/AddressCheckbox';
const SubmitDetail = (props) => {
const [data, setData] = useState([]);
const [title, setTitle] = useState([]);
// const [title, setTitle] = useState([]);
const [disabled, setDisabled] = useState(true);
useEffect(() => {
// const {type} = props.match.params
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/getSearchAddressBook?deptId=47c2c44d41ba15fa0141ba8b7cad0006'
// url: `/idtAppServiceV6/oApp/getLeaders?mobileUse=true&nType=${type}`,
url: `/idtAppServiceV6/oApp/getLeaders?mobileUse=true&nType=1`,
}).then(res => {
setData(res.userList)
setTitle(res.deptList)
setData(res)
});
}, []);
......@@ -34,14 +32,6 @@ const SubmitDetail = (props) => {
}
return (
<div>
<div className='breadBox'>
{title.length > 0 ? title[0].depts : ''}
{/*<span className='currentLink'>科技创新委员会</span>*/}
{/*<span className='symbol'>&gt;</span>*/}
{/*<span>组织架构</span>*/}
{/*<span className='symbol'>&gt;</span>*/}
{/*<span>办公厅</span>*/}
</div>
<div className='adMainBox'>
<AddressCheckbox data={data} setName={checkName}/>
</div>
......
@import '../../variable.less';
#event{
position: fixed;
top: 44px;
left: 0;right: 0; bottom: 50px;
overflow: auto;
margin-bottom: 50px;
padding-bottom: 340px;
}
.event-footer{
......@@ -106,3 +103,7 @@
border-color: @primary !important;
background: @primary !important;
}
.am-action-sheet-button-list-item .am-action-sheet-cancel-button{
color: red;
}
......@@ -5,16 +5,37 @@ import TopNotice from '../../components/NoticeTab'
import axiosRequest from '../../utils/request';
import Document from 'react-document-title'
import Empty from '../Empty'
import useDebounce from '../../useHooks/useDebounce'
// import useDebounce from '../../useHooks/useDebounce'
const Notice = (props) => {
const [loading, setLoading] = useState(false);
const [start, setStart] = useState(true);
const [endT, setEndT] = useState(false);
const [t, setT] = useState(false)
useEffect(() => {
setT(true)
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/getUnDone',
body: {nowPage: 1, pageSize: 10},
}).then(res => {
setT(false);
setStart(false)
let result = end && res.rows ? data.concat(res.rows) : data;
res.rows && res.rows.length >= 10 && setCurrent(1);
setEnd(res.rows && res.rows.length >= 10)
setData(result);
});
}, [])
const [current, setCurrent] = useState(0);
const [searchWord, setSearchWord] = useState()
const [searchWord, setSearchWord] = useState();
const [loading, setLoading] = useState(false);
const [data, setData] = useState([]);
const getData = () => {
const pageMap ={searchWord, nowPage: current + 1, pageSize: 10, FLAG: tab};
const pageMap ={searchWord, nowPage: current + 1, pageSize: 10};
setLoading(true)
axiosRequest({
method: 'post',
......@@ -23,7 +44,7 @@ const Notice = (props) => {
}).then(res => {
setLoading(false);
let result = end && res.rows ? data.concat(res.rows) : data;
res.rows && res.rows.length >= 10 ? setCurrent(current + 1) : Toast.info('当前是最后一页', 1);
res.rows && res.rows.length >= 10 ? setCurrent(current + 1) : setEndT(true);
setEnd(res.rows && res.rows.length >= 10)
setData(result);
});
......@@ -31,18 +52,18 @@ const Notice = (props) => {
//下拉加载
const [end, setEnd] = useState(true)
const handleScroll = useDebounce(() => {
const event = document.getElementById("common-content")
const top = event.scrollTop;
const scrollHeight = event.scrollHeight;
const clientHeight = event.clientHeight;
if (top + clientHeight === scrollHeight) {
const handleScroll = () => {
let scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
let clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
let scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
if(scrollHeight > clientHeight && scrollTop + clientHeight === scrollHeight) {
getData()
}
}, 500)
}
useEffect(() => {
window.addEventListener('scroll', handleScroll, true);
return () => window.removeEventListener('scroll', handleScroll, true);
window.addEventListener('touchmove', handleScroll, true);
return () => window.removeEventListener('touchmove', handleScroll, true);
}, [data]);
const checkLog = () => {
......@@ -51,8 +72,7 @@ const Notice = (props) => {
//回到顶部
useEffect(() => {
const element = document.getElementById('common-content')
element.scrollTo(0, 0)
window.scrollTo(0, 0)
}, []);
//tab已读未读切换
......@@ -86,19 +106,29 @@ const Notice = (props) => {
<ActivityIndicator
toast
text="加载中..."
animating={loading}
animating={t}
/>
<WhiteSpace/>
<TopNotice onSearch={setSearchWord} tabChange={tabChange}/>
{
data.length > 0 ? data.map((item, index) => (
<div key={index}>
<WhiteSpace/>
<TodoCard data={item} onClick={checkLog}/>
</div>
!start && (
data.length > 0 ? data.map((item, index) => (
<div key={index}>
<WhiteSpace/>
<TodoCard data={item} onClick={checkLog}/>
</div>
)) : <Empty/>
)) : <Empty/>
)
}
<WhiteSpace/>
{loading && endT && (
<div className="pos-line mb-10">
<ActivityIndicator/>
<WhiteSpace/>
</div>
)}
</WingBlank>
</Document>
);
......
......@@ -7,6 +7,7 @@ import Document from 'react-document-title'
import Empty from '../Empty'
const Work = (props) => {
const [start, setStart] = useState(true);
const [loading, setLoading] = useState(false)
const [addStatus, setAddStatus] = useState(false);
const [operates, setOperates] = useState([]);
......@@ -23,6 +24,7 @@ const Work = (props) => {
url: '/idtAppServiceV6/oApp/getAllOperate',
}).then(res => {
setLoading(false);
setStart(false)
const result = res ? res.map(item => ({ icon: '', text: item.nodeName })) : []
setOperates(result);
setData(result)
......@@ -53,7 +55,7 @@ const Work = (props) => {
// };
const workUrl = (url) => {
props.history.push(url)
// props.history.push(url)
}
return (
......@@ -67,7 +69,7 @@ const Work = (props) => {
<WhiteSpace/>
<TopSearch onSearch={ workSearch }/>
<WhiteSpace/>
{data.length > 0 ? (
{ !start && (data.length > 0 ? (
<WorkCard
title="工作详情"
addCommon={ commonEdit }
......@@ -76,7 +78,7 @@ const Work = (props) => {
workUrl={workUrl}
iconAction={ itemAdd }
/>
) : <Empty/>}
) : <Empty/>)}
</WingBlank>
</Document>
......
......@@ -8,9 +8,27 @@ import Empty from '../Empty'
import useDebounce from '../../useHooks/useDebounce'
const WorkDetail = (props) => {
const [loading, setLoading] = useState(false);
const [start, setStart] = useState(true);
useEffect(() => {
setLoading(true)
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/getUnDone',
body: {nowPage: 1, pageSize: 10},
}).then(res => {
setLoading(false);
setStart(false)
let result = end && res.rows ? data.concat(res.rows) : data;
res.rows && res.rows.length >= 10 && setCurrent(1);
setEnd(res.rows && res.rows.length >= 10)
setData(result);
});
}, [])
const [current, setCurrent] = useState(0);
const [searchWord, setSearchWord] = useState()
const [searchWord, setSearchWord] = useState();
const [loading, setLoading] = useState(false);
const [data, setData] = useState([]);
const getData = () => {
......@@ -32,11 +50,11 @@ const WorkDetail = (props) => {
//下拉加载
const [end, setEnd] = useState(true)
const handleScroll = useDebounce(() => {
const event = document.getElementById("work-content")
const top = event.scrollTop;
const scrollHeight = event.scrollHeight;
const clientHeight = event.clientHeight;
if (top + clientHeight === scrollHeight) {
let scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
let clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
let scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
if(scrollHeight > clientHeight && scrollTop + clientHeight === scrollHeight) {
getData()
}
}, 500)
......@@ -91,13 +109,16 @@ const WorkDetail = (props) => {
<WhiteSpace/>
<TopNotice onSearch={setSearchWord} tabChange={tabChange}/>
{
data.length > 0 ? data.map((item, index) => (
<div key={index}>
<WhiteSpace/>
<TodoCard data={item} onClick={checkLog}/>
</div>
!start && (
data.length > 0 ? data.map((item, index) => (
<div key={index}>
<WhiteSpace/>
<TodoCard data={item} onClick={checkLog}/>
</div>
)) : <Empty/>
)
)) : <Empty/>
}
</WingBlank>
</div>
......
......@@ -16,8 +16,6 @@ import Login from './pages/Login'
import NoFound from './pages/NoFound'
const ReactRouter = () => {
return (
<Router>
......@@ -37,7 +35,7 @@ const ReactRouter = () => {
<BlankLayout>
<Route path="/blank/work/:id" component={WorkDetail}/>
<Route path="/blank/submit/:type" component={SubmitDetail}/>
<Route path="/blank/info/:id/:UUID" component={Process}/>
<Route path="/blank/info/:id/:uuid" component={Process}/>
</BlankLayout>
}/>
<Route component={NoFound}/>
......
......@@ -58,8 +58,12 @@ export const createAPI = (baseURL) => {
}, conf.opts))
.then(function (response) {
response = response.data;
console.log(response)
if (!response || !response.data) { console.log('response出错, 无返回数据!', response); return false; };
if (!response || !response.data) {
window.location.href = '/login'
console.log('response出错, 无返回数据!', response); return false;
};
if (response.data && response.data.errorMessage) {
Toast.fail(response.data.errorMessage);
return false;
......
@primary: #0185FB;
@grayLight:rgba(0,0,0,0.12);
/* http://meyerweb.com/eric/tools/css/reset/
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
......@@ -14,8 +14,8 @@ b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
......@@ -26,7 +26,7 @@ time, mark, audio, video {
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
......@@ -81,4 +81,4 @@ table {
.icon18{
width:18px;
height: 18px;
}
\ No newline at end of file
}
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