Commit 70a59b90 authored by 熊成伟's avatar 熊成伟

debug

parent 51d5046c
Pipeline #15227 failed with stages
in 28 seconds
This diff is collapsed.
...@@ -9543,11 +9543,6 @@ ...@@ -9543,11 +9543,6 @@
"resolved": "https://registry.npm.taobao.org/q/download/q-1.5.1.tgz", "resolved": "https://registry.npm.taobao.org/q/download/q-1.5.1.tgz",
"integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc="
}, },
"qs": {
"version": "6.5.2",
"resolved": "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz",
"integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY="
},
"query-string": { "query-string": {
"version": "4.3.4", "version": "4.3.4",
"resolved": "https://registry.npm.taobao.org/query-string/download/query-string-4.3.4.tgz", "resolved": "https://registry.npm.taobao.org/query-string/download/query-string-4.3.4.tgz",
...@@ -10555,6 +10550,13 @@ ...@@ -10555,6 +10550,13 @@
"tough-cookie": "~2.5.0", "tough-cookie": "~2.5.0",
"tunnel-agent": "^0.6.0", "tunnel-agent": "^0.6.0",
"uuid": "^3.3.2" "uuid": "^3.3.2"
},
"dependencies": {
"qs": {
"version": "6.5.2",
"resolved": "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz",
"integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY="
}
} }
}, },
"require-directory": { "require-directory": {
......
import React from 'react'; import React, {useState} from 'react';
import {Tabs, Icon} from 'antd-mobile' import {Tabs, Icon} from 'antd-mobile'
import './index.less' import './index.less'
const tabs = [ const tabs = [
{ title: '未读', sub: '1' }, { title: '未读', sub: 'N' },
{ title: '已读', sub: '2' } { title: '已读', sub: 'D' }
] ]
const Index = (props) => { const Index = (props) => {
const {tabChange, onSearch} = props;
const [status, setStatus] = useState(false);
const topSearch = () => {
const input = document.getElementsByClassName("top-single-search");
let inputValue = input[0].value;
setStatus(inputValue != null && inputValue !== '')
};
const enterPress = (e) => {
const input = document.getElementsByClassName("top-single-search");
if (e.keyCode === 13) {
props.onSearch(input[0].value);
}
}
const clear = () => {
setStatus(false)
const input = document.getElementsByClassName("top-single-search");
input[0].value = null;
input[0].focus();
props.onSearch('');
}
return ( return (
<div className="pos-line"> <div className="pos-line">
<div className="search-notice-box"> <div className="search-notice-box">
<Icon type="search" size="xs" className="search-svg"/> <Icon type="search" size="xs" className="search-svg"/>
<input className="top-search" placeholder="请输入关键字搜索" /> <input onChange={topSearch} onKeyDown={enterPress} className="top-single-search" placeholder="请输入关键字搜索" />
{status && (
<Icon type="cross-circle-o" color="rgba(35, 35, 35, 0.3)" size="xxs" className="clear-svg" onClick={clear}/>
)}
</div> </div>
<div className="search-tab"> <div className="search-tab">
<Tabs <Tabs
tabs={tabs} tabs={tabs}
initialPage={'1'} initialPage={'1'}
onChange={(tab, index) => { console.log('onChange', tab); }} onChange={(tab, index) => tabChange(tab.sub)}
/> />
</div> </div>
</div> </div>
......
...@@ -8,10 +8,15 @@ const Index = (props) => { ...@@ -8,10 +8,15 @@ const Index = (props) => {
const topSearch = () => { const topSearch = () => {
const input = document.getElementsByClassName("top-single-search"); const input = document.getElementsByClassName("top-single-search");
props.onSearch(input[0].value);
let inputValue = input[0].value; let inputValue = input[0].value;
setStatus(inputValue != null && inputValue !== '') setStatus(inputValue != null && inputValue !== '')
}; };
const enterPress = (e) => {
const input = document.getElementsByClassName("top-single-search");
if (e.keyCode === 13) {
props.onSearch(input[0].value);
}
}
const clear = () => { const clear = () => {
setStatus(false) setStatus(false)
const input = document.getElementsByClassName("top-single-search"); const input = document.getElementsByClassName("top-single-search");
...@@ -22,7 +27,7 @@ const Index = (props) => { ...@@ -22,7 +27,7 @@ const Index = (props) => {
return ( return (
<div className="search-box"> <div className="search-box">
<Icon type="search" size="xs" className="search-svg"/> <Icon type="search" size="xs" className="search-svg"/>
<input onChange={topSearch} className="top-single-search" placeholder="请输入关键字搜索" /> <input onChange={topSearch} onKeyDown={enterPress} className="top-single-search" placeholder="请输入关键字搜索" />
{status && ( {status && (
<Icon type="cross-circle-o" color="rgba(35, 35, 35, 0.3)" size="xxs" className="clear-svg" onClick={clear}/> <Icon type="cross-circle-o" color="rgba(35, 35, 35, 0.3)" size="xxs" className="clear-svg" onClick={clear}/>
)} )}
......
...@@ -20,3 +20,4 @@ body, ...@@ -20,3 +20,4 @@ body,
} }
ul, p{margin: 0;padding: 0} ul, p{margin: 0;padding: 0}
ul{list-style: none} ul{list-style: none}
...@@ -27,7 +27,7 @@ const Footer = (props) => { ...@@ -27,7 +27,7 @@ const Footer = (props) => {
{title: '待办', key: 'backlog', icon: '/img/footer-backlog.png', selectedIcon: '/img/footer-backlog-s.png', badge: badge, onPress: '/bord/backlog'}, {title: '待办', key: 'backlog', icon: '/img/footer-backlog.png', selectedIcon: '/img/footer-backlog-s.png', badge: badge, onPress: '/bord/backlog'},
{title: '工作', key: 'work', icon: '/img/footer-work.png', selectedIcon: '/img/footer-work-s.png', badge: '', onPress: '/bord/work'}, {title: '工作', key: 'work', icon: '/img/footer-work.png', selectedIcon: '/img/footer-work-s.png', badge: '', onPress: '/bord/work'},
{title: '通讯录', key: 'addressList', icon: '/img/footer-communicate.png', selectedIcon: '/img/footer-communicate-s.png', badge: '', onPress: '/bord/addressList'}, {title: '通讯录', key: 'addressList', icon: '/img/footer-communicate.png', selectedIcon: '/img/footer-communicate-s.png', badge: '', onPress: '/bord/addressList'},
{title: '通知', key: 'notice', icon: '/img/footer-notice.png', selectedIcon: '/img/footer-notice-s.png', badge: '', onPress: '/bord/notice'} {title: '通知', key: 'notice', icon: '/img/footer-notice.png', selectedIcon: '/img/footer-notice-s.png', badge: badge, onPress: '/bord/notice'}
]; ];
return ( return (
<div id="footer" className="footer"> <div id="footer" className="footer">
......
...@@ -4,9 +4,10 @@ import TodoCard from '../../components/LogCard' ...@@ -4,9 +4,10 @@ import TodoCard from '../../components/LogCard'
import TopSearch from '../../components/TopSearch'; import TopSearch from '../../components/TopSearch';
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'
const Backlog = (props) => { const Backlog = (props) => {
const [current, setCurrent] = useState(1); const [current, setCurrent] = useState(0);
const [searchWord, setSearchWord] = useState() const [searchWord, setSearchWord] = useState()
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
...@@ -17,26 +18,22 @@ const Backlog = (props) => { ...@@ -17,26 +18,22 @@ const Backlog = (props) => {
props.history.push(`/blank/info/${OPERATEID}`) props.history.push(`/blank/info/${OPERATEID}`)
}; };
const getData = () => { const getData = () => {
const pageMap ={searchWord, nowPage: current, pageSize: 10}; const pageMap ={searchWord, nowPage: current + 1, pageSize: 10};
console.log(pageMap)
setLoading(true) setLoading(true)
axiosRequest({ axiosRequest({
method: 'post', method: 'post',
url: '/idtAppServiceV6/oApp/getUnDone', url: '/idtAppServiceV6/oApp/getUnDone',
body: pageMap, body: pageMap,
}).then(res => { }).then(res => {
console.log(res)
setLoading(false); setLoading(false);
let result = res.rows ? data.concat(res.rows) : data; let result = end && res.rows ? data.concat(res.rows) : data;
res.rows && res.rows.length >= 10 ? setCurrent(current + 1) : setEnd(false);
setData(result); setData(result);
setCurrent(current + 1);
}); });
}; };
useEffect(() => {
getData()
}, [searchWord])
//下拉加载 //下拉加载
const [end, setEnd] = useState(true)
const handleScroll = () => { const handleScroll = () => {
const event = document.getElementById("common-content") const event = document.getElementById("common-content")
const top = event.scrollTop; const top = event.scrollTop;
...@@ -58,9 +55,12 @@ const Backlog = (props) => { ...@@ -58,9 +55,12 @@ const Backlog = (props) => {
}, []) }, [])
const wordSearch = val => { const wordSearch = val => {
setSearchWord(val) setSearchWord(val);
getData() getData()
} };
useEffect(() => {
getData()
}, [searchWord])
return ( return (
<Document title="待办"> <Document title="待办">
<WingBlank> <WingBlank>
...@@ -72,13 +72,13 @@ const Backlog = (props) => { ...@@ -72,13 +72,13 @@ const Backlog = (props) => {
<WhiteSpace/> <WhiteSpace/>
<TopSearch onSearch={wordSearch}/> <TopSearch onSearch={wordSearch}/>
{ {
data.map((item, index) => ( data.length > 0 ? data.map((item, index) => (
<div key={index}> <div key={index}>
<WhiteSpace/> <WhiteSpace/>
<TodoCard data={item} onClick={() => checkLog(item.OPERATEID)}/> <TodoCard data={item} onClick={() => checkLog(item.OPERATEID)}/>
</div> </div>
)) )) : <Empty/>
} }
</WingBlank> </WingBlank>
</Document> </Document>
......
...@@ -4,6 +4,7 @@ import AddressList from '../../components/AddressList'; ...@@ -4,6 +4,7 @@ import AddressList from '../../components/AddressList';
import axiosRequest from '../../utils/request'; import axiosRequest from '../../utils/request';
import {ActivityIndicator} from "antd-mobile"; import {ActivityIndicator} from "antd-mobile";
import './index.less' import './index.less'
import Empty from '../Empty'
const AddressBook = (props) => { const AddressBook = (props) => {
...@@ -41,7 +42,10 @@ const AddressBook = (props) => { ...@@ -41,7 +42,10 @@ const AddressBook = (props) => {
animating={loading} animating={loading}
/> />
<div className='adMainBox'> <div className='adMainBox'>
<AddressList data={data} onCLick={treeClick}/> {data.length > 0 ? (
<AddressList data={data} onCLick={treeClick}/>
): <Empty/>}
</div> </div>
</div> </div>
......
...@@ -3,6 +3,7 @@ import AddressUser from '../../components/AddressList/AddressUser'; ...@@ -3,6 +3,7 @@ import AddressUser from '../../components/AddressList/AddressUser';
import axiosRequest from '../../utils/request'; import axiosRequest from '../../utils/request';
import {ActivityIndicator} from "antd-mobile"; import {ActivityIndicator} from "antd-mobile";
import Document from 'react-document-title' import Document from 'react-document-title'
import Empty from '../Empty'
const Communicate = (props) => { const Communicate = (props) => {
...@@ -39,7 +40,8 @@ const Communicate = (props) => { ...@@ -39,7 +40,8 @@ const Communicate = (props) => {
{title.length > 0 ? title[0].depts : ''} {title.length > 0 ? title[0].depts : ''}
</div> </div>
<div className='adMainBox'> <div className='adMainBox'>
<AddressUser data={data}/> {data.length > 0 ? <AddressUser data={data}/> : <Empty/>}
</div> </div>
</div> </div>
......
import React from 'react';
import './index.less'
const Empty = () => {
return (
<div>
<div className="empty-box">
<div className="empty-img"/>
暂无数据
</div>
</div>
);
};
export default Empty;
...@@ -4,29 +4,31 @@ import TodoCard from '../../components/LogCard' ...@@ -4,29 +4,31 @@ 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 Document from 'react-document-title' import Document from 'react-document-title'
import Empty from '../Empty'
const Notice = (props) => { const Notice = (props) => {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [current, setCurrent] = useState(1); const [current, setCurrent] = useState(0);
const [searchWord, setSearchWord] = useState() const [searchWord, setSearchWord] = useState()
const [data, setData] = useState([]); const [data, setData] = useState([]);
const getData = () => { const getData = () => {
const pageMap ={searchWord, nowPage: current, pageSize: 10}; const pageMap ={searchWord, nowPage: current + 1, pageSize: 10};
console.log(pageMap)
setLoading(true) setLoading(true)
axiosRequest({ axiosRequest({
method: 'post', method: 'post',
url: '/idtAppServiceV6/oApp/getUnDone', url: '/idtAppServiceV6/oApp/getUnDone',
body: pageMap,
}).then(res => { }).then(res => {
setLoading(false); setLoading(false);
let result = res.rows ? data.concat(res.rows) : data; let result = end && res.rows ? data.concat(res.rows) : data;
res.rows && res.rows.length >= 10 ? setCurrent(current + 1) : setEnd(false);
setData(result); setData(result);
setCurrent(current + 1);
}); });
}; };
//下拉加载 //下拉加载
const [end, setEnd] = useState(true)
const handleScroll = () => { const handleScroll = () => {
const event = document.getElementById("common-content") const event = document.getElementById("common-content")
const top = event.scrollTop; const top = event.scrollTop;
...@@ -52,10 +54,10 @@ const Notice = (props) => { ...@@ -52,10 +54,10 @@ const Notice = (props) => {
}, []); }, []);
//tab已读未读切换 //tab已读未读切换
const [tab, setTab] = useState('') const [tab, setTab] = useState('N')
const tabChange = val => { const tabChange = val => {
setTab(val) setTab(val);
console.log(val) setData([])
}; };
useEffect(() => { useEffect(() => {
...@@ -72,13 +74,13 @@ const Notice = (props) => { ...@@ -72,13 +74,13 @@ const Notice = (props) => {
<WhiteSpace/> <WhiteSpace/>
<TopNotice onSearch={setSearchWord} tabChange={tabChange}/> <TopNotice onSearch={setSearchWord} tabChange={tabChange}/>
{ {
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}/>
</div> </div>
)) )) : <Empty/>
} }
</WingBlank> </WingBlank>
</Document> </Document>
......
...@@ -4,6 +4,7 @@ import axiosRequest from '../../utils/request'; ...@@ -4,6 +4,7 @@ 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 Document from 'react-document-title' import Document from 'react-document-title'
import Empty from '../Empty'
const Work = (props) => { const Work = (props) => {
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
...@@ -66,14 +67,17 @@ const Work = (props) => { ...@@ -66,14 +67,17 @@ const Work = (props) => {
<WhiteSpace/> <WhiteSpace/>
<TopSearch onSearch={ workSearch }/> <TopSearch onSearch={ workSearch }/>
<WhiteSpace/> <WhiteSpace/>
<WorkCard {data.length > 0 ? (
title="工作详情" <WorkCard
addCommon={ commonEdit } title="工作详情"
addStatus={addStatus} addCommon={ commonEdit }
data={data} addStatus={addStatus}
workUrl={workUrl} data={data}
iconAction={ itemAdd } workUrl={workUrl}
/> iconAction={ itemAdd }
/>
) : <Empty/>}
</WingBlank> </WingBlank>
</Document> </Document>
); );
......
...@@ -7,28 +7,29 @@ import './index.less' ...@@ -7,28 +7,29 @@ import './index.less'
const WorkDetail = (props) => { const WorkDetail = (props) => {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [current, setCurrent] = useState(1); const [current, setCurrent] = useState(0);
const [searchWord, setSearchWord] = useState() const [searchWord, setSearchWord] = useState()
const [data, setData] = useState([]); const [data, setData] = useState([]);
const getData = () => { const getData = () => {
const pageMap ={searchWord, nowPage: current, pageSize: 10}; const pageMap ={searchWord, nowPage: current + 1, pageSize: 10};
console.log(pageMap)
setLoading(true) setLoading(true)
axiosRequest({ axiosRequest({
method: 'post', method: 'post',
url: '/idtAppServiceV6/getWaitDealList', url: '/idtAppServiceV6/oApp/getUnDone',
body: pageMap,
}).then(res => { }).then(res => {
setLoading(false); setLoading(false);
let result = res.rows ? data.concat(res.rows) : data let result = end && res.rows ? data.concat(res.rows) : data;
setData(result) res.rows && res.rows.length >= 10 ? setCurrent(current + 1) : setEnd(false);
setCurrent(current + 1) setData(result);
}); });
}; };
//下拉加载 //下拉加载
const [end, setEnd] = useState(true)
const handleScroll = () => { const handleScroll = () => {
const event = document.getElementById("work-content") const event = document.getElementById("common-content")
const top = event.scrollTop; const top = event.scrollTop;
const scrollHeight = event.scrollHeight; const scrollHeight = event.scrollHeight;
const clientHeight = event.clientHeight; const clientHeight = event.clientHeight;
......
.empty-box{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
margin-top: 80px;
color:rgba(125,125,125,1);
}
.empty-img{
width: 187px;
height: 187px;
background: url("/img/empty.png") center no-repeat;
background-size: cover;
margin-bottom: 20px;
}
import axios from 'axios'; import axios from 'axios';
import { stringify } from 'qs';
import { Toast } from 'antd-mobile'; import { Toast } from 'antd-mobile';
const instance = axios.create(); const instance = axios.create();
...@@ -34,9 +33,21 @@ export const createAPI = (baseURL) => { ...@@ -34,9 +33,21 @@ export const createAPI = (baseURL) => {
let urlParams = ''; let urlParams = '';
let headers = { ...defaultHeaders, ...opts.headers }; let headers = { ...defaultHeaders, ...opts.headers };
if (conf.queryType === 'query') { if (conf.opts) {
urlParams = conf.body ? "?" + stringify(conf.body) : ''; urlParams = "?";
let keys = Object.keys(conf.opts);
keys.map(item => {
let value = conf.opts[item];
if (value !== null && value !== undefined && value !== '') {
urlParams += `${item}=${conf.opts[item]}&`
}
return null
});
urlParams = urlParams.substr(0, urlParams.length - 1)
} }
// if (conf.queryType === 'query') {
// urlParams = conf.body ? "?" + stringify(conf.body) : '';
// }
return instance(Object.assign({}, { return instance(Object.assign({}, {
url: conf.url + urlParams, url: conf.url + urlParams,
......
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