Commit db448486 authored by 熊成伟's avatar 熊成伟

debug

parent 442c94cc
Pipeline #15297 passed with stages
in 56 seconds
This diff is collapsed.
import React from 'react';
import './index.less'
const Index = () => {
return (
<div className="loading">
<span/>
<span/>
<span/>
<span/>
<span/>
</div>
);
};
export default Index;
.loading{
width: 100%;
height: 20px;
margin: 9px auto;
display: flex;
justify-content: center;
}
.loading span{
display: inline-block;
width: 8px;
height: 100%;
border-radius: 4px;
background: rgba(35,35,35,0.13);
-webkit-animation: load 1s ease infinite;
}
@-webkit-keyframes load{
0%,100%{
height: 20px;
background: rgba(35,35,35,0.13);
}
50%{
height: 40px;
margin: -15px 0;
background: rgba(35,35,35,0.1);
}
}
.loading span:nth-child(2){
-webkit-animation-delay:0.2s;
}
.loading span:nth-child(3){
-webkit-animation-delay:0.4s;
}
.loading span:nth-child(4){
-webkit-animation-delay:0.6s;
}
.loading span:nth-child(5){
-webkit-animation-delay:0.8s;
}
...@@ -21,7 +21,7 @@ const Index = (props) => { ...@@ -21,7 +21,7 @@ const Index = (props) => {
<img <img
alt="" alt=""
className="todo-read-png" className="todo-read-png"
src={props.data && props.data.read ? '/img/read.png' : '/img/unread.png'} src={props.data && props.data.FLAG === 'D' ? '/img/read.png' : '/img/unread.png'}
/> />
</span> </span>
</div> </div>
......
import React from 'react'; import React from 'react';
import ContentLoader, { Facebook } from 'react-content-loader' import ContentLoader from 'react-content-loader'
import './index.less' import './index.less'
const Index = () => { const Index = () => {
......
...@@ -32,7 +32,8 @@ const CardItem = (props) => { ...@@ -32,7 +32,8 @@ const CardItem = (props) => {
) )
} }
<img src={data.icon} className="card-content-img-svg" alt="" />
<img src={data.icon ? `/img/icon/${data.icon}.png` : "/img/add-work.png"} className="card-content-img-svg" alt="" />
</div> </div>
<div className="card-content-title"> <div className="card-content-title">
{data.text} {data.text}
......
import React, {useState, useEffect} from 'react'; import React, {useState, useEffect} from 'react';
import {WhiteSpace, WingBlank, ActivityIndicator} from 'antd-mobile' import {WhiteSpace, WingBlank} from 'antd-mobile'
import TodoCard from '../../components/LogCard' import TodoCard from '../../components/LogCard'
import TopSearch from '../../components/TopSearch'; import TopSearch from '../../components/TopSearch';
import Skeleton from '../../components/Skeleton' import Skeleton from '../../components/Skeleton'
import Loading from '../../components/Loading'
import axiosRequest from '../../utils/request'; import axiosRequest from '../../utils/request';
import Document from 'react-document-title' import Document from 'react-document-title'
import Empty from '../Empty' import Empty from '../Empty'
...@@ -11,7 +12,6 @@ import './index.less' ...@@ -11,7 +12,6 @@ import './index.less'
const Backlog = (props) => { const Backlog = (props) => {
const [start, setStart] = useState(true); const [start, setStart] = useState(true);
const [end, setEnd] = useState(true) const [end, setEnd] = useState(true)
const [endT, setEndT] = useState(false);
useEffect(() => { useEffect(() => {
//回到顶部 //回到顶部
...@@ -26,9 +26,10 @@ const Backlog = (props) => { ...@@ -26,9 +26,10 @@ const Backlog = (props) => {
const checkLog = (OPERATEID, UUID) => { const checkLog = (OPERATEID, UUID) => {
props.history.push(`/blank/info/${OPERATEID}/${UUID}`) props.history.push(`/blank/info/${OPERATEID}/${UUID}`)
}; };
const getData = () => { const getData = (scroll) => {
const pageMap ={searchWord, nowPage: current + 1, pageSize: 10}; const pageMap ={searchWord, nowPage: current + 1, pageSize: 10};
setLoading(true); setLoading(true);
scroll && current > 0 && window.scrollTo(0, document.body.scrollHeight);
axiosRequest({ axiosRequest({
method: 'post', method: 'post',
url: '/idtAppServiceV6/oApp/getUnDone', url: '/idtAppServiceV6/oApp/getUnDone',
...@@ -49,8 +50,7 @@ const Backlog = (props) => { ...@@ -49,8 +50,7 @@ const Backlog = (props) => {
let clientHeight = document.documentElement.clientHeight || document.body.clientHeight; let clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
let scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight; let scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
if(scrollHeight > clientHeight && scrollTop + clientHeight === scrollHeight) { if(scrollHeight > clientHeight && scrollTop + clientHeight === scrollHeight) {
current > 0 && window.scrollTo(0, document.body.scrollHeight); getData(true)
getData()
} }
} }
useEffect(() => { useEffect(() => {
...@@ -64,7 +64,6 @@ const Backlog = (props) => { ...@@ -64,7 +64,6 @@ const Backlog = (props) => {
}; };
useEffect(() => { useEffect(() => {
setStart(true); setStart(true);
setEndT(false)
setData([]) setData([])
!start && getData() !start && getData()
}, [searchWord]); }, [searchWord]);
...@@ -88,7 +87,8 @@ const Backlog = (props) => { ...@@ -88,7 +87,8 @@ const Backlog = (props) => {
<WhiteSpace/> <WhiteSpace/>
{loading && ( {loading && (
<div className="pos-line content-loading"> <div className="pos-line content-loading">
<ActivityIndicator/> <Loading/>
<WhiteSpace/>
<WhiteSpace/> <WhiteSpace/>
</div> </div>
)} )}
......
import React, {useState, useEffect} from 'react'; import React, {useState, useEffect} from 'react';
import {WhiteSpace} from 'antd-mobile'
import AddressUser from '../../components/AddressList/AddressUser'; import AddressUser from '../../components/AddressList/AddressUser';
import axiosRequest from '../../utils/request'; import axiosRequest from '../../utils/request';
import {ActivityIndicator} from "antd-mobile"; import Skeleton from '../../components/Skeleton'
import Document from 'react-document-title' import Document from 'react-document-title'
import Empty from '../Empty' import Empty from '../Empty'
...@@ -33,18 +34,14 @@ const Communicate = (props) => { ...@@ -33,18 +34,14 @@ const Communicate = (props) => {
return ( return (
<Document title="通讯录"> <Document title="通讯录">
<div> <div>
<ActivityIndicator
toast
text="加载中..."
animating={loading}
/>
<div className='breadBox'> <div className='breadBox'>
{title.length > 0 ? title[0].depts : ''} {title && title.length > 0 ? title[0].depts : ''}
</div>
<div className='adMainBox'>
{ !start && (data.length > 0 ? <AddressUser data={data}/> : <Empty/>)}
</div> </div>
{loading ? <div><WhiteSpace/><Skeleton/></div> : (
<div className='adMainBox'>
{ data && !start && (data.length > 0 ? <AddressUser data={data}/> : <Empty/>)}
</div>
)}
</div> </div>
</Document> </Document>
......
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, ActivityIndicator} from 'antd-mobile' import {WingBlank, WhiteSpace, ActionSheet} 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'
import Basic from './Basic' import Basic from './Basic'
import Adjunct from './Adjunct' import Adjunct from './Adjunct'
import Flow from './Flow'; import Flow from './Flow';
...@@ -41,12 +41,14 @@ const Process = (props) => { ...@@ -41,12 +41,14 @@ const Process = (props) => {
}, []); }, []);
//获取basic数据 //获取basic数据
const [basic, setBasic] = useState([]); const [basic, setBasic] = useState([]);
const [basicLoading, setBasicLoading] = useState(false)
const getBasic = uuid => { const getBasic = uuid => {
axiosRequest({ axiosRequest({
method: 'post', method: 'post',
url: `/idtAppServiceV6/oApp/getData`, url: `/idtAppServiceV6/oApp/getData`,
body: {uuid, tableId, templateId} body: {uuid, tableId, templateId}
}).then(res => { }).then(res => {
setBasicLoading(true)
const result = [...basic]; const result = [...basic];
result.map(item => { result.map(item => {
item.content = res[item.title] item.content = res[item.title]
...@@ -57,24 +59,27 @@ const Process = (props) => { ...@@ -57,24 +59,27 @@ const Process = (props) => {
} }
//获取Flow数据 //获取Flow数据
const [flowData, setFlowData] = useState([]); const [flowData, setFlowData] = useState([]);
const [flowLoading, setFlowLoading] = useState(false)
const getFlow = uuid => { const getFlow = uuid => {
axiosRequest({ axiosRequest({
method: 'post', method: 'post',
url: `/idtAppServiceV6/oApp/getFlowList`, url: `/idtAppServiceV6/oApp/getFlowList`,
body: {uuid, tableId} body: {uuid, tableId}
}).then(res => { }).then(res => {
setFlowLoading(true)
setFlowData(res) setFlowData(res)
}); });
}; };
const [adjunctData, setAdjunctData] = useState([]); const [adjunctData, setAdjunctData] = useState([]);
const [adjunctLoading, setAdjunctLoading] = useState(false)
const getAdjunct= uuid => { const getAdjunct= uuid => {
axiosRequest({ axiosRequest({
method: 'post', method: 'post',
url: `/idtAppServiceV6/oApp/getFiles`, url: `/idtAppServiceV6/oApp/getFiles`,
body: {uuid, fieldName: 'fj', tableId} body: {uuid, fieldName: 'fj', tableId}
}).then(res => { }).then(res => {
setAdjunctLoading(true)
setAdjunctData(res) setAdjunctData(res)
}); });
}; };
...@@ -97,8 +102,6 @@ const Process = (props) => { ...@@ -97,8 +102,6 @@ const Process = (props) => {
getButton() getButton()
}, [nodeId]); }, [nodeId]);
const [loading, setLoading] = useState(false);
//提交按钮状态 //提交按钮状态
const [disabled, setDisabled] = useState(true); const [disabled, setDisabled] = useState(true);
//提交按钮文字 //提交按钮文字
...@@ -109,11 +112,12 @@ const Process = (props) => { ...@@ -109,11 +112,12 @@ const Process = (props) => {
setFootStatus(true) setFootStatus(true)
}; };
useEffect(() => { useEffect(() => {
setLoading(false); const option = document.getElementsByClassName("option-text")[0];
const option = document.getElementsByClassName("option-text")[0] if (option) {
option.addEventListener('focus', optionBlur, true); option.addEventListener('focus', optionBlur, true);
return () => option.removeEventListener('focus', optionBlur, true); return () => option.removeEventListener('focus', optionBlur, true);
}, []); }
}, [basic]);
const [blyj, setBlyj] = useState() const [blyj, setBlyj] = useState()
const optionChange = val => { const optionChange = val => {
...@@ -216,30 +220,25 @@ const Process = (props) => { ...@@ -216,30 +220,25 @@ const Process = (props) => {
return () => window.removeEventListener('scroll', handleScroll, true); return () => window.removeEventListener('scroll', handleScroll, true);
}, []); }, []);
return ( return (
<Document title="待办详情"> <Document title="待办详情">
<div> <div>
<ActivityIndicator
toast
text="加载中..."
animating={loading}
/>
<TopTabs page={current} onClick={tabClick}/> <TopTabs page={current} onClick={tabClick}/>
<div id="event"> <div id="event">
<WingBlank> <WingBlank>
<div id="event-basic"/> <div id="event-basic"/>
<WhiteSpace/> <WhiteSpace/>
<Basic data={basic}/> {basicLoading ? <Basic data={basic}/> : <Skeleton/>}
<div id="event-adjunct"/> <div id="event-adjunct"/>
<WhiteSpace/> <WhiteSpace/>
<Adjunct data={adjunctData}/> {adjunctLoading ? <Adjunct data={adjunctData}/> : <Skeleton/>}
<div id="event-flow"/> <div id="event-flow"/>
<WhiteSpace/> <WhiteSpace/>
<Flow data={flowData}/> {flowLoading ? <Flow data={flowData}/> : <Skeleton/>}
<div id="event-option"/> <div id="event-option"/>
<WhiteSpace/> <WhiteSpace/>
<Option onChange={optionChange}/> {basicLoading ? <Option onChange={optionChange}/> : <Skeleton/>}
</WingBlank> </WingBlank>
</div> </div>
<div className="event-footer"> <div className="event-footer">
......
import React, {useEffect, useState} from 'react'; import React, {useEffect, useState} from 'react';
import {ActivityIndicator, Toast, WhiteSpace, WingBlank} from 'antd-mobile' import {WhiteSpace, WingBlank} from 'antd-mobile'
import TodoCard from '../../components/LogCard' import TodoCard from '../../components/LogCard'
import TopNotice from '../../components/NoticeTab' import TopNotice from '../../components/NoticeTab'
import axiosRequest from '../../utils/request'; import axiosRequest from '../../utils/request';
import Skeleton from '../../components/Skeleton' import Skeleton from '../../components/Skeleton'
import Document from 'react-document-title' import Document from 'react-document-title'
import Empty from '../Empty' import Empty from '../Empty'
// import useDebounce from '../../useHooks/useDebounce' import Loading from "../../components/Loading";
const Notice = (props) => { const Notice = (props) => {
const [start, setStart] = useState(true); const [start, setStart] = useState(true);
const [end, setEnd] = useState(true) const [end, setEnd] = useState(true)
const [endT, setEndT] = useState(false);
const [current, setCurrent] = useState(0); const [current, setCurrent] = useState(0);
const [searchWord, setSearchWord] = useState(); const [searchWord, setSearchWord] = useState();
...@@ -20,9 +19,10 @@ const Notice = (props) => { ...@@ -20,9 +19,10 @@ const Notice = (props) => {
const [data, setData] = useState([]); const [data, setData] = useState([]);
const getData = () => { const getData = (scroll) => {
const pageMap ={searchWord, nowPage: current + 1, pageSize: 10, FLAG: tab}; const pageMap ={searchWord, nowPage: current + 1, pageSize: 10, FLAG: tab};
setLoading(true); setLoading(true);
scroll && current > 0 && window.scrollTo(0, document.body.scrollHeight)
axiosRequest({ axiosRequest({
method: 'post', method: 'post',
url: '/idtAppServiceV6/oApp/getUnDone', url: '/idtAppServiceV6/oApp/getUnDone',
...@@ -31,6 +31,8 @@ const Notice = (props) => { ...@@ -31,6 +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;
console.log('end', end, 'result',result, 'res', res)
res.rows && res.rows.length >= 10 && setCurrent(1); res.rows && res.rows.length >= 10 && setCurrent(1);
setData(result); setData(result);
setLoading(false); setLoading(false);
...@@ -44,8 +46,7 @@ const Notice = (props) => { ...@@ -44,8 +46,7 @@ const Notice = (props) => {
let scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight; let scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
if(scrollHeight > clientHeight && scrollTop + clientHeight === scrollHeight) { if(scrollHeight > clientHeight && scrollTop + clientHeight === scrollHeight) {
current > 0 && window.scrollTo(0, document.body.scrollHeight) getData(true)
getData()
} }
} }
useEffect(() => { useEffect(() => {
...@@ -64,27 +65,17 @@ const Notice = (props) => { ...@@ -64,27 +65,17 @@ const Notice = (props) => {
//tab已读未读切换 //tab已读未读切换
const [tab, setTab] = useState('N'); const [tab, setTab] = useState('N');
// const tabData = () => {
// const pageMap ={searchWord, nowPage: current + 1, pageSize: 10, FLAG: tab};
// setLoading(true);
// axiosRequest({
// method: 'post',
// url: '/idtAppServiceV6/oApp/getUnDone',
// body: pageMap,
// }).then(res => {
// setLoading(false);
// let result = start && res.rows ? [].concat(res.rows) : [];
// res.rows && res.rows.length >= 10 ? setCurrent(current + 1) : setEndT(true);
// setData(result);
// });
// };
const tabChange = val => { const tabChange = val => {
setCurrent(0) setCurrent(0);
setData([]);
setTab(val); setTab(val);
setEnd(true)
}; };
const tabSearch = val => { const tabSearch = val => {
setCurrent(0) setCurrent(0);
setData([])
setSearchWord(val) setSearchWord(val)
setEnd(true)
} }
useEffect(() => { useEffect(() => {
//回到顶部 //回到顶部
...@@ -93,12 +84,11 @@ const Notice = (props) => { ...@@ -93,12 +84,11 @@ const Notice = (props) => {
}, []) }, [])
useEffect(() => { useEffect(() => {
setStart(true); setStart(true);
setEndT(false) getData(false, [])
setData([])
setCurrent(0)
getData()
}, [searchWord, tab]); }, [searchWord, tab]);
console.log(current)
console.log(data.length)
return ( return (
<Document title="通知"> <Document title="通知">
<WingBlank> <WingBlank>
...@@ -116,7 +106,8 @@ const Notice = (props) => { ...@@ -116,7 +106,8 @@ const Notice = (props) => {
<WhiteSpace/> <WhiteSpace/>
{loading && ( {loading && (
<div className="pos-line content-loading"> <div className="pos-line content-loading">
<ActivityIndicator/> <Loading/>
<WhiteSpace/>
<WhiteSpace/> <WhiteSpace/>
</div> </div>
)} )}
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import {WhiteSpace, WingBlank} from "antd-mobile"; import {WhiteSpace, WingBlank} from "antd-mobile";
import axiosRequest from '../../utils/request'; // import axiosRequest from '../../utils/request';
import TopSearch from '../../components/TopSearch' import TopSearch from '../../components/TopSearch'
import WorkCard from '../../components/WorkCard'; import WorkCard from '../../components/WorkCard';
import Skeleton from '../../components/Skeleton' import Skeleton from '../../components/Skeleton'
...@@ -19,17 +19,27 @@ const Work = (props) => { ...@@ -19,17 +19,27 @@ const Work = (props) => {
}, []); }, []);
const loadOperates = () => { const loadOperates = () => {
setLoading(true) setLoading(true);
axiosRequest({ setTimeout(() => {
method: 'post', setLoading(false)
url: '/idtAppServiceV6/oApp/getAllOperate', }, 1000)
}).then(res => { const res = localStorage.getItem("menu");
setLoading(false); setStart(false);
setStart(false) const result = JSON.parse(res)
const result = res ? res.map(item => ({ icon: '', text: item.nodeName })) : [] setOperates(result);
setOperates(result); setData(result);
setData(result)
}); // let ss = []
// JSON.parse(res).map(item => ss.push(item.text));
// let a = new Set(ss)
// console.log([...a].join(','))
// axiosRequest({
// method: 'post',
// url: '/idtAppServiceV6/oApp/getAllOperate',
// }).then(res => {
// setLoading(false);
//
// });
} }
const commonEdit = () => { const commonEdit = () => {
......
...@@ -30,9 +30,9 @@ let defaultHeaders = { ...@@ -30,9 +30,9 @@ let defaultHeaders = {
export const createAPI = (baseURL) => { export const createAPI = (baseURL) => {
return (conf = {}) => { return (conf = {}) => {
let opts = conf.opts || {}; let opts = conf.opts || {};
let body = conf.body || {}; // let body = conf.body || {};
let urlParams = ''; let urlParams = '';
console.log(conf) // console.log(conf)
let headers = { ...defaultHeaders, ...opts.headers }; let headers = { ...defaultHeaders, ...opts.headers };
if (conf.opts) { if (conf.opts) {
...@@ -52,7 +52,7 @@ export const createAPI = (baseURL) => { ...@@ -52,7 +52,7 @@ export const createAPI = (baseURL) => {
// console.log(response) // console.log(response)
if (!response || !response.data) { if (!response || !response.data) {
response.code === 'idt-core-505' && (window.location.href = '/login') response.code === 'idt-core-500' && (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) {
...@@ -67,7 +67,9 @@ export const createAPI = (baseURL) => { ...@@ -67,7 +67,9 @@ export const createAPI = (baseURL) => {
localStorage.setItem("token", response.data.token); localStorage.setItem("token", response.data.token);
} }
if (response && response.data && response.data.leftOperateBar) { if (response && response.data && response.data.leftOperateBar) {
localStorage.setItem("menu", JSON.stringify(response.data.leftOperateBar)); const result = response.data.leftOperateBar.filter(item => item.nodeName === '公共分组');
const menu = result.length > 0 && result[0].children ? result[0].children.map(item => ({ icon: item.imgType, text: item.nodeName })) : [];
result.length > 0 && localStorage.setItem("menu", JSON.stringify(menu));
} }
if (response.data) { if (response.data) {
......
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