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 @@
"resolved": "https://registry.npm.taobao.org/q/download/q-1.5.1.tgz",
"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": {
"version": "4.3.4",
"resolved": "https://registry.npm.taobao.org/query-string/download/query-string-4.3.4.tgz",
......@@ -10555,6 +10550,13 @@
"tough-cookie": "~2.5.0",
"tunnel-agent": "^0.6.0",
"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": {
......
import React from 'react';
import React, {useState} from 'react';
import {Tabs, Icon} from 'antd-mobile'
import './index.less'
const tabs = [
{ title: '未读', sub: '1' },
{ title: '已读', sub: '2' }
{ title: '未读', sub: 'N' },
{ title: '已读', sub: 'D' }
]
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 (
<div className="pos-line">
<div className="search-notice-box">
<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 className="search-tab">
<Tabs
tabs={tabs}
initialPage={'1'}
onChange={(tab, index) => { console.log('onChange', tab); }}
onChange={(tab, index) => tabChange(tab.sub)}
/>
</div>
</div>
......
......@@ -8,10 +8,15 @@ const Index = (props) => {
const topSearch = () => {
const input = document.getElementsByClassName("top-single-search");
props.onSearch(input[0].value);
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");
......@@ -22,7 +27,7 @@ const Index = (props) => {
return (
<div className="search-box">
<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 && (
<Icon type="cross-circle-o" color="rgba(35, 35, 35, 0.3)" size="xxs" className="clear-svg" onClick={clear}/>
)}
......
......@@ -20,3 +20,4 @@ body,
}
ul, p{margin: 0;padding: 0}
ul{list-style: none}
......@@ -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: '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: '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 (
<div id="footer" className="footer">
......
......@@ -4,9 +4,10 @@ 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'
const Backlog = (props) => {
const [current, setCurrent] = useState(1);
const [current, setCurrent] = useState(0);
const [searchWord, setSearchWord] = useState()
const [loading, setLoading] = useState(false);
......@@ -17,26 +18,22 @@ const Backlog = (props) => {
props.history.push(`/blank/info/${OPERATEID}`)
};
const getData = () => {
const pageMap ={searchWord, nowPage: current, pageSize: 10};
console.log(pageMap)
const pageMap ={searchWord, nowPage: current + 1, pageSize: 10};
setLoading(true)
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/getUnDone',
body: pageMap,
}).then(res => {
console.log(res)
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);
setCurrent(current + 1);
});
};
useEffect(() => {
getData()
}, [searchWord])
//下拉加载
const [end, setEnd] = useState(true)
const handleScroll = () => {
const event = document.getElementById("common-content")
const top = event.scrollTop;
......@@ -58,9 +55,12 @@ const Backlog = (props) => {
}, [])
const wordSearch = val => {
setSearchWord(val)
setSearchWord(val);
getData()
}
};
useEffect(() => {
getData()
}, [searchWord])
return (
<Document title="待办">
<WingBlank>
......@@ -72,13 +72,13 @@ const Backlog = (props) => {
<WhiteSpace/>
<TopSearch onSearch={wordSearch}/>
{
data.map((item, index) => (
data.length > 0 ? data.map((item, index) => (
<div key={index}>
<WhiteSpace/>
<TodoCard data={item} onClick={() => checkLog(item.OPERATEID)}/>
</div>
))
)) : <Empty/>
}
</WingBlank>
</Document>
......
......@@ -4,6 +4,7 @@ import AddressList from '../../components/AddressList';
import axiosRequest from '../../utils/request';
import {ActivityIndicator} from "antd-mobile";
import './index.less'
import Empty from '../Empty'
const AddressBook = (props) => {
......@@ -41,7 +42,10 @@ const AddressBook = (props) => {
animating={loading}
/>
<div className='adMainBox'>
{data.length > 0 ? (
<AddressList data={data} onCLick={treeClick}/>
): <Empty/>}
</div>
</div>
......
......@@ -3,6 +3,7 @@ import AddressUser from '../../components/AddressList/AddressUser';
import axiosRequest from '../../utils/request';
import {ActivityIndicator} from "antd-mobile";
import Document from 'react-document-title'
import Empty from '../Empty'
const Communicate = (props) => {
......@@ -39,7 +40,8 @@ const Communicate = (props) => {
{title.length > 0 ? title[0].depts : ''}
</div>
<div className='adMainBox'>
<AddressUser data={data}/>
{data.length > 0 ? <AddressUser data={data}/> : <Empty/>}
</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'
import TopNotice from '../../components/NoticeTab'
import axiosRequest from '../../utils/request';
import Document from 'react-document-title'
import Empty from '../Empty'
const Notice = (props) => {
const [loading, setLoading] = useState(false);
const [current, setCurrent] = useState(1);
const [current, setCurrent] = useState(0);
const [searchWord, setSearchWord] = useState()
const [data, setData] = useState([]);
const getData = () => {
const pageMap ={searchWord, nowPage: current, pageSize: 10};
console.log(pageMap)
const pageMap ={searchWord, nowPage: current + 1, pageSize: 10};
setLoading(true)
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/getUnDone',
body: pageMap,
}).then(res => {
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);
setCurrent(current + 1);
});
};
//下拉加载
const [end, setEnd] = useState(true)
const handleScroll = () => {
const event = document.getElementById("common-content")
const top = event.scrollTop;
......@@ -52,10 +54,10 @@ const Notice = (props) => {
}, []);
//tab已读未读切换
const [tab, setTab] = useState('')
const [tab, setTab] = useState('N')
const tabChange = val => {
setTab(val)
console.log(val)
setTab(val);
setData([])
};
useEffect(() => {
......@@ -72,13 +74,13 @@ const Notice = (props) => {
<WhiteSpace/>
<TopNotice onSearch={setSearchWord} tabChange={tabChange}/>
{
data.map((item, index) => (
data.length > 0 ? data.map((item, index) => (
<div key={index}>
<WhiteSpace/>
<TodoCard data={item} onClick={checkLog}/>
</div>
))
)) : <Empty/>
}
</WingBlank>
</Document>
......
......@@ -4,6 +4,7 @@ import axiosRequest from '../../utils/request';
import TopSearch from '../../components/TopSearch'
import WorkCard from '../../components/WorkCard';
import Document from 'react-document-title'
import Empty from '../Empty'
const Work = (props) => {
const [loading, setLoading] = useState(false)
......@@ -66,6 +67,7 @@ const Work = (props) => {
<WhiteSpace/>
<TopSearch onSearch={ workSearch }/>
<WhiteSpace/>
{data.length > 0 ? (
<WorkCard
title="工作详情"
addCommon={ commonEdit }
......@@ -74,6 +76,8 @@ const Work = (props) => {
workUrl={workUrl}
iconAction={ itemAdd }
/>
) : <Empty/>}
</WingBlank>
</Document>
);
......
......@@ -7,28 +7,29 @@ import './index.less'
const WorkDetail = (props) => {
const [loading, setLoading] = useState(false);
const [current, setCurrent] = useState(1);
const [current, setCurrent] = useState(0);
const [searchWord, setSearchWord] = useState()
const [data, setData] = useState([]);
const getData = () => {
const pageMap ={searchWord, nowPage: current, pageSize: 10};
console.log(pageMap)
const pageMap ={searchWord, nowPage: current + 1, pageSize: 10};
setLoading(true)
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/getWaitDealList',
url: '/idtAppServiceV6/oApp/getUnDone',
body: pageMap,
}).then(res => {
setLoading(false);
let result = res.rows ? data.concat(res.rows) : data
setData(result)
setCurrent(current + 1)
let result = end && res.rows ? data.concat(res.rows) : data;
res.rows && res.rows.length >= 10 ? setCurrent(current + 1) : setEnd(false);
setData(result);
});
};
//下拉加载
const [end, setEnd] = useState(true)
const handleScroll = () => {
const event = document.getElementById("work-content")
const event = document.getElementById("common-content")
const top = event.scrollTop;
const scrollHeight = event.scrollHeight;
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 { stringify } from 'qs';
import { Toast } from 'antd-mobile';
const instance = axios.create();
......@@ -34,9 +33,21 @@ export const createAPI = (baseURL) => {
let urlParams = '';
let headers = { ...defaultHeaders, ...opts.headers };
if (conf.queryType === 'query') {
urlParams = conf.body ? "?" + stringify(conf.body) : '';
if (conf.opts) {
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({}, {
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