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) => {
<img
alt=""
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>
</div>
......
import React from 'react';
import ContentLoader, { Facebook } from 'react-content-loader'
import ContentLoader from 'react-content-loader'
import './index.less'
const Index = () => {
......
......@@ -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 className="card-content-title">
{data.text}
......
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 TopSearch from '../../components/TopSearch';
import Skeleton from '../../components/Skeleton'
import Loading from '../../components/Loading'
import axiosRequest from '../../utils/request';
import Document from 'react-document-title'
import Empty from '../Empty'
......@@ -11,7 +12,6 @@ import './index.less'
const Backlog = (props) => {
const [start, setStart] = useState(true);
const [end, setEnd] = useState(true)
const [endT, setEndT] = useState(false);
useEffect(() => {
//回到顶部
......@@ -26,9 +26,10 @@ const Backlog = (props) => {
const checkLog = (OPERATEID, UUID) => {
props.history.push(`/blank/info/${OPERATEID}/${UUID}`)
};
const getData = () => {
const getData = (scroll) => {
const pageMap ={searchWord, nowPage: current + 1, pageSize: 10};
setLoading(true);
scroll && current > 0 && window.scrollTo(0, document.body.scrollHeight);
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/getUnDone',
......@@ -49,8 +50,7 @@ const Backlog = (props) => {
let clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
let scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
if(scrollHeight > clientHeight && scrollTop + clientHeight === scrollHeight) {
current > 0 && window.scrollTo(0, document.body.scrollHeight);
getData()
getData(true)
}
}
useEffect(() => {
......@@ -64,7 +64,6 @@ const Backlog = (props) => {
};
useEffect(() => {
setStart(true);
setEndT(false)
setData([])
!start && getData()
}, [searchWord]);
......@@ -88,7 +87,8 @@ const Backlog = (props) => {
<WhiteSpace/>
{loading && (
<div className="pos-line content-loading">
<ActivityIndicator/>
<Loading/>
<WhiteSpace/>
<WhiteSpace/>
</div>
)}
......
import React, {useState, useEffect} from 'react';
import {WhiteSpace} from 'antd-mobile'
import AddressUser from '../../components/AddressList/AddressUser';
import axiosRequest from '../../utils/request';
import {ActivityIndicator} from "antd-mobile";
import Skeleton from '../../components/Skeleton'
import Document from 'react-document-title'
import Empty from '../Empty'
......@@ -33,18 +34,14 @@ const Communicate = (props) => {
return (
<Document title="通讯录">
<div>
<ActivityIndicator
toast
text="加载中..."
animating={loading}
/>
<div className='breadBox'>
{title.length > 0 ? title[0].depts : ''}
{title && title.length > 0 ? title[0].depts : ''}
</div>
{loading ? <div><WhiteSpace/><Skeleton/></div> : (
<div className='adMainBox'>
{ !start && (data.length > 0 ? <AddressUser data={data}/> : <Empty/>)}
{ data && !start && (data.length > 0 ? <AddressUser data={data}/> : <Empty/>)}
</div>
)}
</div>
</Document>
......
import React, {useState, useEffect} from 'react';
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 TopTabs from '../../components/BlankTabs'
// import Skeleton from '../../components/Skeleton'
import Skeleton from '../../components/Skeleton'
import Basic from './Basic'
import Adjunct from './Adjunct'
import Flow from './Flow';
......@@ -41,12 +41,14 @@ const Process = (props) => {
}, []);
//获取basic数据
const [basic, setBasic] = useState([]);
const [basicLoading, setBasicLoading] = useState(false)
const getBasic = uuid => {
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/getData`,
body: {uuid, tableId, templateId}
}).then(res => {
setBasicLoading(true)
const result = [...basic];
result.map(item => {
item.content = res[item.title]
......@@ -57,24 +59,27 @@ const Process = (props) => {
}
//获取Flow数据
const [flowData, setFlowData] = useState([]);
const [flowLoading, setFlowLoading] = useState(false)
const getFlow = uuid => {
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/getFlowList`,
body: {uuid, tableId}
}).then(res => {
setFlowLoading(true)
setFlowData(res)
});
};
const [adjunctData, setAdjunctData] = useState([]);
const [adjunctLoading, setAdjunctLoading] = useState(false)
const getAdjunct= uuid => {
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/getFiles`,
body: {uuid, fieldName: 'fj', tableId}
}).then(res => {
setAdjunctLoading(true)
setAdjunctData(res)
});
};
......@@ -97,8 +102,6 @@ const Process = (props) => {
getButton()
}, [nodeId]);
const [loading, setLoading] = useState(false);
//提交按钮状态
const [disabled, setDisabled] = useState(true);
//提交按钮文字
......@@ -109,11 +112,12 @@ const Process = (props) => {
setFootStatus(true)
};
useEffect(() => {
setLoading(false);
const option = document.getElementsByClassName("option-text")[0]
const option = document.getElementsByClassName("option-text")[0];
if (option) {
option.addEventListener('focus', optionBlur, true);
return () => option.removeEventListener('focus', optionBlur, true);
}, []);
}
}, [basic]);
const [blyj, setBlyj] = useState()
const optionChange = val => {
......@@ -216,30 +220,25 @@ const Process = (props) => {
return () => window.removeEventListener('scroll', handleScroll, true);
}, []);
return (
<Document title="待办详情">
<div>
<ActivityIndicator
toast
text="加载中..."
animating={loading}
/>
<TopTabs page={current} onClick={tabClick}/>
<div id="event">
<WingBlank>
<div id="event-basic"/>
<WhiteSpace/>
<Basic data={basic}/>
{basicLoading ? <Basic data={basic}/> : <Skeleton/>}
<div id="event-adjunct"/>
<WhiteSpace/>
<Adjunct data={adjunctData}/>
{adjunctLoading ? <Adjunct data={adjunctData}/> : <Skeleton/>}
<div id="event-flow"/>
<WhiteSpace/>
<Flow data={flowData}/>
{flowLoading ? <Flow data={flowData}/> : <Skeleton/>}
<div id="event-option"/>
<WhiteSpace/>
<Option onChange={optionChange}/>
{basicLoading ? <Option onChange={optionChange}/> : <Skeleton/>}
</WingBlank>
</div>
<div className="event-footer">
......
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 TopNotice from '../../components/NoticeTab'
import axiosRequest from '../../utils/request';
import Skeleton from '../../components/Skeleton'
import Document from 'react-document-title'
import Empty from '../Empty'
// import useDebounce from '../../useHooks/useDebounce'
import Loading from "../../components/Loading";
const Notice = (props) => {
const [start, setStart] = useState(true);
const [end, setEnd] = useState(true)
const [endT, setEndT] = useState(false);
const [current, setCurrent] = useState(0);
const [searchWord, setSearchWord] = useState();
......@@ -20,9 +19,10 @@ const Notice = (props) => {
const [data, setData] = useState([]);
const getData = () => {
const getData = (scroll) => {
const pageMap ={searchWord, nowPage: current + 1, pageSize: 10, FLAG: tab};
setLoading(true);
scroll && current > 0 && window.scrollTo(0, document.body.scrollHeight)
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/getUnDone',
......@@ -31,6 +31,8 @@ const Notice = (props) => {
setStart(false);
setEnd(res.rows && res.rows.length >= 10)
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);
setData(result);
setLoading(false);
......@@ -44,8 +46,7 @@ const Notice = (props) => {
let scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
if(scrollHeight > clientHeight && scrollTop + clientHeight === scrollHeight) {
current > 0 && window.scrollTo(0, document.body.scrollHeight)
getData()
getData(true)
}
}
useEffect(() => {
......@@ -64,27 +65,17 @@ const Notice = (props) => {
//tab已读未读切换
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 => {
setCurrent(0)
setCurrent(0);
setData([]);
setTab(val);
setEnd(true)
};
const tabSearch = val => {
setCurrent(0)
setCurrent(0);
setData([])
setSearchWord(val)
setEnd(true)
}
useEffect(() => {
//回到顶部
......@@ -93,12 +84,11 @@ const Notice = (props) => {
}, [])
useEffect(() => {
setStart(true);
setEndT(false)
setData([])
setCurrent(0)
getData()
getData(false, [])
}, [searchWord, tab]);
console.log(current)
console.log(data.length)
return (
<Document title="通知">
<WingBlank>
......@@ -116,7 +106,8 @@ const Notice = (props) => {
<WhiteSpace/>
{loading && (
<div className="pos-line content-loading">
<ActivityIndicator/>
<Loading/>
<WhiteSpace/>
<WhiteSpace/>
</div>
)}
......
import React, { useState, useEffect } from 'react';
import {WhiteSpace, WingBlank} from "antd-mobile";
import axiosRequest from '../../utils/request';
// import axiosRequest from '../../utils/request';
import TopSearch from '../../components/TopSearch'
import WorkCard from '../../components/WorkCard';
import Skeleton from '../../components/Skeleton'
......@@ -19,17 +19,27 @@ const Work = (props) => {
}, []);
const loadOperates = () => {
setLoading(true)
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/getAllOperate',
}).then(res => {
setLoading(false);
setStart(false)
const result = res ? res.map(item => ({ icon: '', text: item.nodeName })) : []
setLoading(true);
setTimeout(() => {
setLoading(false)
}, 1000)
const res = localStorage.getItem("menu");
setStart(false);
const result = JSON.parse(res)
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 = () => {
......
......@@ -30,9 +30,9 @@ let defaultHeaders = {
export const createAPI = (baseURL) => {
return (conf = {}) => {
let opts = conf.opts || {};
let body = conf.body || {};
// let body = conf.body || {};
let urlParams = '';
console.log(conf)
// console.log(conf)
let headers = { ...defaultHeaders, ...opts.headers };
if (conf.opts) {
......@@ -52,7 +52,7 @@ export const createAPI = (baseURL) => {
// console.log(response)
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;
};
if (response.data && response.data.errorMessage) {
......@@ -67,7 +67,9 @@ export const createAPI = (baseURL) => {
localStorage.setItem("token", response.data.token);
}
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) {
......
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