Commit 8aa664bd authored by 熊成伟's avatar 熊成伟

debug

parent e07acead
Pipeline #15212 failed with stages
in 29 seconds
This diff is collapsed.
......@@ -4,9 +4,9 @@ server {
#charset koi8-r;
access_log /var/log/nginx/host.access.log main;
location /dgbg {
proxy_pass http://124.93.101.8:9988/dgbg/;
location /idtAppServiceV6 {
proxy_pass http://124.93.101.8:9988/idtAppServiceV6/;
}
location / {
root /usr/share/nginx/html;
......@@ -50,4 +50,4 @@ server {
#location ~ /\.ht {
# deny all;
#}
}
\ No newline at end of file
}
......@@ -5,7 +5,7 @@ const Index = (props) => {
const data = props.data;
return (
<div className="address-box">
{data.map((item, index) => item.title && (
{data && data.length > 0 && data.map((item, index) => item.title && (
<div key={index}>
<div className="address-item">
1111111111
......
......@@ -2,10 +2,10 @@ import React from 'react';
import './index.less'
const Index = (props) => {
const data = props.data;
const {data} = props;
return (
<div className="address-box">
{data.map((item, index) => item.title && (
{data && data.length > 0 && data.map((item, index) => item.title && (
<div className="address-item">
{item.title || '11'}
<img src="/img/rarrow.png" alt="" className='icon18'/>
......
......@@ -2,6 +2,7 @@ import React from 'react';
import './index.less'
const Index = (props) => {
const {data} = props
return (
<div className="todo-card" onClick={props.onClick}>
<div className="todo-title pos-aline">
......@@ -12,9 +13,9 @@ const Index = (props) => {
className="todo-tag-png"
src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1591252471425&di=85236ae603ca74553adaca6e8c161a39&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2Fb912bf96dc19b3b23530ae2259b60eb6cf70083f6680b-H9l0ri_fw658"
/>
{props.TYPE}
{data.TYPE}
</div>
<p>{props.TITLE}</p>
<p>{data.TITLE}</p>
</div>
<span>
<img
......@@ -25,8 +26,8 @@ const Index = (props) => {
</span>
</div>
<div className="todo-content">
<p>当前状态:{props.STATUS}</p>
<p style={{marginTop: 15}}>发送人员:{props.FROMUSER_ALIASED}</p>
<p>当前状态:{data.STATUS}</p>
<p style={{marginTop: 15}}>发送人员:{data.FROMUSER_ALIASED}</p>
</div>
<div className="todo-footer">
<div>
......
......@@ -18,6 +18,7 @@
background: @primary;
color: #ffffff;
border-radius:3px;
margin-right: 8px;
}
.todo-tag-png{
width: 12px;
......
......@@ -18,7 +18,7 @@ const Index = (props) => {
<Tabs
tabs={tabs}
initialPage={'1'}
onChange={(tab, index) => { console.log('onChange', index, tab); }}
onChange={(tab, index) => { console.log('onChange', tab); }}
/>
</div>
</div>
......
......@@ -17,6 +17,7 @@ const Index = (props) => {
const input = document.getElementsByClassName("top-single-search");
input[0].value = null;
input[0].focus();
props.onSearch('');
}
return (
<div className="search-box">
......
......@@ -11,7 +11,7 @@ const CardItem = (props) => {
}, [addStatus])
const contentCLick = () => {
!status && !data.iconAdd && workUrl('/blank/work/1')
!status && !data.iconAdd && data.text && workUrl('/blank/work/1')
data.iconAdd && addCommon()
};
const iconClick = () => {
......
import React from 'react';
import React, {useState, useEffect} from 'react';
import './index.less'
import CardItem from './CardItem'
const Index = (props) => {
const {title, type, addStatus, addCommon, data, iconAction, workUrl} = props;
const emptyIcon = type === 'edit' ? {
text: addStatus ? '完成添加' :'添加常用', icon: addStatus ? '/img/finish-work.png' : '/img/add-work.png', iconAdd: true
} : {};
const empty = data.length % 3;
empty === 0 && data.push(emptyIcon, {}, {});
empty === 1 && data.push(emptyIcon, {});
empty === 2 && data.push(emptyIcon);
return (
const [card, setCard] = useState([]);
useEffect(() => {
const result = [...data]
const emptyIcon = type === 'edit' ? {
text: addStatus ? '完成添加' :'添加常用', icon: addStatus ? '/img/finish-work.png' : '/img/add-work.png', iconAdd: true
} : {};
const empty = data.length % 3;
empty === 0 && result.push(emptyIcon, {}, {});
empty === 1 && result.push(emptyIcon, {});
empty === 2 && result.push(emptyIcon);
setCard(result)
}, [data])
return data.length > 0 && (
<div>
<div className="work-card-title">
{title}
</div>
<div className="work-card-body">
{data.map((item, index) => (
{card.map((item, index) => (
<CardItem
type={type}
key={index}
......
import React, {Component} from 'react';
import React, {useState, useEffect} from 'react';
import {TabBar} from 'antd-mobile'
import './index.less'
class Footer extends Component {
state={
current: ''
}
componentDidMount() {
const keysArray = this.props.location.pathname.replace(`${this.props.match.path}/`, '').split("/");
keysArray.length > 0 && this.setState({current: keysArray[0]})
}
tabClick = (key, path) => {
this.setState({current: key})
this.props.history.push(path)
}
render() {
const tabItem = [
{title: '待办', key: 'backlog', icon: '/img/footer-backlog.png', selectedIcon: '/img/footer-backlog-s.png', 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'}
];
return (
<div id="footer" className="footer">
<TabBar
unselectedTintColor="#949494"
tintColor="#2E67EA"
barTintColor="white"
>
{tabItem.map(item => (
<TabBar.Item
key={item.key}
title={item.title}
icon={<img alt="" className="footer-tab-icon" src={item.icon}/>}
selectedIcon={ <img alt="" className="footer-tab-icon" src={item.selectedIcon}/>}
badge={item.badge || null}
onPress={() => this.tabClick(item.key, item.onPress)}
selected={this.state.current === item.key}
/>
))}
</TabBar>
</div>
);
import axiosRequest from '../utils/request';
const Footer = (props) => {
const [current, setCurrent] = useState()
useEffect(() => {
const keysArray = props.location.pathname.replace(`${props.match.path}/`, '').split("/");
keysArray.length > 0 && setCurrent(keysArray[0]);
getData()
}, []);
const getData = () => {
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/getWaitDealList',
}).then(res => {
console.log(res)
});
}
}
const tabClick = (key, path) => {
setCurrent(key);
props.history.push(path)
};
const tabItem = [
{title: '待办', key: 'backlog', icon: '/img/footer-backlog.png', selectedIcon: '/img/footer-backlog-s.png', 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'}
];
return (
<div id="footer" className="footer">
<TabBar
unselectedTintColor="#949494"
tintColor="#2E67EA"
barTintColor="white"
>
{tabItem.map(item => (
<TabBar.Item
key={item.key}
title={item.title}
icon={<img alt="" className="footer-tab-icon" src={item.icon}/>}
selectedIcon={ <img alt="" className="footer-tab-icon" src={item.selectedIcon}/>}
badge={item.badge || null}
onPress={() => tabClick(item.key, item.onPress)}
selected={current === item.key}
/>
))}
</TabBar>
</div>
);
};
export default Footer;
......@@ -10,10 +10,10 @@ const Backlog = (props) => {
const [loading, setLoading] = useState(false);
const [data, setData] = useState([{},{},{},{},{},{}]);
const [data, setData] = useState([]);
const checkLog = () => {
props.history.push(`/blank/info/example/1`)
const checkLog = (TABLEID) => {
props.history.push(`/blank/info/example/${TABLEID}`)
};
const getData = () => {
const pageMap ={searchWord, nowPage: current, pageSize: 10};
......@@ -21,14 +21,17 @@ const Backlog = (props) => {
setLoading(true)
axiosRequest({
method: 'post',
url: '/dgbg/mobileGetOperates.view?userName=2012012099&clientFlag=123456',
url: '/idtAppServiceV6/getWaitDealList',
}).then(res => {
setLoading(false);
let result = data.concat([{}, {}, {}, {}, {}, {}])
setData(result)
setCurrent(current + 1)
let result = res.rows ? data.concat(res.rows) : data;
setData(result);
setCurrent(current + 1);
});
};
useEffect(() => {
getData()
}, [searchWord])
//下拉加载
const handleScroll = () => {
......@@ -64,7 +67,7 @@ const Backlog = (props) => {
data.map((item, index) => (
<div key={index}>
<WhiteSpace/>
<TodoCard data={item} onClick={checkLog}/>
<TodoCard data={item} onClick={() => checkLog(item.TABLEID)}/>
</div>
))
......
import React, {useState, useEffect} from 'react';
import AddressList from '../../components/AddressList';
import AddressUser from '../../components/AddressList/AddressUser';
import axiosRequest from '../../utils/request';
import {ActivityIndicator} from "antd-mobile";
const AddressBook = (props) => {
const [loading, setLoading] = useState(false);
const [data, setData] = useState([]);
const [type, setType] = useState('basic')
// const {id} = props.match.params;
// console.log(id, ss);
const getData = () => {
setLoading(true);
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/getDeptTree',
}).then(res => {
setLoading(false);
setData()
});
};
useEffect(() => {
getData()
}, []);
const treeClick = () => {
};
return (
<div>
<ActivityIndicator
toast
text="加载中..."
animating={loading}
/>
<div className='breadBox'>
<span className='currentLink'>科技创新委员会</span>
<span className='symbol'>&gt;</span>
......@@ -14,9 +46,7 @@ const AddressBook = (props) => {
<span>办公厅</span>
</div>
<div className='adMainBox'>
<AddressList data={[{title: '1'}, {title: 2}, {title: 3}]}/>
<AddressUser data={[{title: '1', children: [{}, {}, {}]}, {title: 2, children: [{}, {}, {}]}, {title: 3, children: [{}, {}, {}]}]}/>
<AddressUser data={data} onCLick={}/>
</div>
</div>
......
// import React, {Component} from 'react';
// import './index.less'
//
// class Communicate extends Component {
//
// render() {
// return (
// <div>
// <div className='breadBox'>
// <span className='currentLink'>科技创新委员会</span><span className='symbol'>&gt;</span><span>组织架构</span><span className='symbol'>&gt;</span><span>办公厅</span>
// </div>
// <div className='adMainBox'>
// <ul className='adListBox'>
// <li>
// <div className='itemBox'>
// <h4 className='titleBar'>市委办公厅审核员</h4>
// <div className='adContent'>
// <div className='peopleList'>
// <p className='subItem'>
// <span className='cicrleHead mr-5'>
// <img src='/img/head.png' className='imgRes' />
// </span>
// 王磊
// </p>
// <p className='subItem'>
// <img className='smallIco mr-5' src='/img/tel.png' />13488876526
// </p>
// </div>
// <div className='peopleList'>
// <p className='subItem'>
// <span className='cicrleHead mr-5 centerFont'>
// 王
// </span>
// 王磊
// </p>
// <p className='subItem'>
// <img className='smallIco mr-5' src='/img/tel.png' />13488876526
// </p>
// </div>
// </div>
// </div>
// </li>
// <li>
// <div className='itemBox'>
// <h4 className='titleBar'>市委办公厅审核员</h4>
// <div className='adContent'>
// <div className='peopleList'>
// <p className='subItem'>
// <span className='cicrleHead mr-5'>
// <img src='/img/head.png' className='imgRes' />
// </span>
// 王磊
// </p>
// <p className='subItem'>
// <img className='smallIco mr-5' src='/img/tel.png' />13488876526
// </p>
// </div>
// <div className='peopleList'>
// <p className='subItem'>
// <span className='cicrleHead mr-5 centerFont'>
// 王
// </span>
// 王磊
// </p>
// <p className='subItem'>
// <img className='smallIco mr-5' src='/img/tel.png' />13488876526
// </p>
// </div>
// </div>
// </div>
// </li>
// </ul>
// </div>
// </div>
// );
// }
// }
//
// export default Communicate;
import React from 'react';
import React, {useState, useEffect} from 'react';
import AddressList from '../../components/AddressList';
import AddressUser from '../../components/AddressList/AddressUser';
const AddressBook = (props) => {
import axiosRequest from '../../utils/request';
import {ActivityIndicator} from "antd-mobile";
const Communicate = (props) => {
const [loading, setLoading] = useState(false);
const [data, setData] = useState([]);
const [type, setType] = useState('basic')
// const {id} = props.match.params;
// console.log(id, ss);
const getData = () => {
setLoading(true);
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/getSearchAddressBook',
}).then(res => {
setLoading(false);
setData()
});
};
useEffect(() => {
if (props.location.query && props.location.query.parent) {
const {parent} = props.location.query;
}
// const {parent} = props.location.query;
console.log(props.location.query)
getData()
}, []);
const getCurrent = () =>{
}
return (
<div>
<ActivityIndicator
toast
text="加载中..."
animating={loading}
/>
<div className='breadBox'>
<span className='currentLink'>科技创新委员会</span>
<span className='symbol'>&gt;</span>
......@@ -96,8 +52,6 @@ const AddressBook = (props) => {
<span>办公厅</span>
</div>
<div className='adMainBox'>
<AddressList data={[{title: '1'}, {title: 2}, {title: 3}]}/>
<AddressUser data={[{title: '1', children: [{}, {}, {}]}, {title: 2, children: [{}, {}, {}]}, {title: 3, children: [{}, {}, {}]}]}/>
</div>
......@@ -105,5 +59,5 @@ const AddressBook = (props) => {
);
};
export default AddressBook;
export default Communicate;
import React from 'react';
import React, {useEffect, useState} from 'react';
import List from '../../components/List'
import AdjunctList from '../../components/Adjunct'
import axiosRequest from '../../utils/request';
const da222 = Array.from(new Array(7)).map((_val, i) => ({
id: `name${i}`,
text: `name${i}`,
}));
const Adjunct = () => {
const Adjunct = (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, data)
setData([])
});
}, []);
const listData = [
{title: '开始时间', content: '文电科'},
{title: '结束时间', content: '3'},
......
import React from 'react';
import React, {useState, useEffect} from 'react';
import './index.less'
import List from '../../components/List'
import axiosRequest from '../../utils/request';
const Basic = (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([])
});
}, [])
const data = Array.from(new Array(12)).map((_val, i) => ({
icon: '/img/test/test.png',
text: `name${i}`,
}));
const Basic = () => {
const personImg = data.map((item, index) => (
<div key={index} className="basic-people-item">
<img className="work-people-img" alt="" src='/img/test/test.png'/>
......
import React from 'react';
import React, {useEffect, useState} from 'react';
import StepCard from '../../components/StepCard'
import axiosRequest from '../../utils/request';
const Flow = () => {
const Flow = (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/>
<StepCard data={data}/>
</div>
);
};
......
import React, {Component} from 'react';
import React, {useState, useEffect} from 'react';
import {Modal} from 'antd-mobile'
import './index.less';
import axiosRequest from '../../utils/request';
const operation = Modal.operation;
class Option extends Component {
state = {
}
onChange = () => {
const Option = (props) => {
const onChange = () => {
const input = document.getElementsByClassName("option-text");
this.props.onChange(input[0].value)
props.onChange(input[0].value)
};
setValue = (val) => {
const setValue = (val) => {
const input = document.getElementsByClassName("option-text");
input[0].value = val
};
render() {
return (
<div>
<div className="option-card">
<div className="option-title">
<div>流转意见:</div>
<a
className="option-fast"
onClick={() => operation([
{ text: '默认一', onPress: () => this.setValue('默认一') },
{ text: '默认二', onPress: () => this.setValue('默认二') },
])}
>
常用阅办意见<img alt="" src="/img/option-icon.png" className="option-icon"/>
</a>
</div>
<textarea className="option-text" onChange={this.onChange}/>
useEffect(() => {
axiosRequest({
method: 'post',
url: '/dgbg/mobileGetListOptionKey.view?userName=2012012099&clientFlag=123456',
}).then(res => {
console.log(res)
});
}, [])
return (
<div>
<div className="option-card">
<div className="option-title">
<div>流转意见:</div>
<a
className="option-fast"
onClick={() => operation([
{ text: '默认一', onPress: () => setValue('默认一') },
{ text: '默认二', onPress: () => setValue('默认二') },
])}
>
常用阅办意见<img alt="" src="/img/option-icon.png" className="option-icon"/>
</a>
</div>
<textarea className="option-text" onChange={onChange}/>
</div>
);
}
}
</div>
);
};
export default Option;
import React, {useState, useEffect} from 'react';
import {WingBlank, WhiteSpace, ActionSheet, ActivityIndicator} from 'antd-mobile'
import axiosRequest from '../../utils/request';
import './index.less'
import TopTabs from '../../components/BlankTabs'
import Basic from './Basic'
......@@ -10,6 +11,8 @@ import Option from './Option';
const Pro = (props) => {
const [loading, setLoading] = useState(false);
const [tableId, setTableId] = useState()
//提交按钮状态
const [disabled, setDisabled] = useState(true)
//提交按钮文字
......@@ -21,7 +24,6 @@ const Pro = (props) => {
};
useEffect(() => {
setLoading(false);
const option = document.getElementsByClassName("option-text")[0]
option.addEventListener('focus', optionBlur, true);
return () => option.removeEventListener('focus', optionBlur, true);
......@@ -32,7 +34,6 @@ const Pro = (props) => {
};
const [current, setCurrent] = useState('basic');
const [footStatus, setFootStatus] = useState(false);
//点击输入框, 聚焦移动
......@@ -70,10 +71,18 @@ const Pro = (props) => {
wrapProps,
},
(buttonIndex) => {
props.history.push(`/blank/submit/1`)
// console.log(buttonIndex)
buttonIndex > 1 && props.history.push(`/blank/submit/1`)
console.log(buttonIndex)
});
};
const processEnd = () => {
axiosRequest({
method: 'post',
url: `/dgbg/MobileGetFlowsByTabId.view?userName=2012012099&clientFlag=123456&tableId=${tableId}`,
}).then(res => {
console.log(res)
});
}
const handleScroll = () => {
const adjunct = document.getElementById("event-adjunct").offsetTop;
......
......@@ -2,13 +2,16 @@ import React, {Component} from 'react';
import AddressList from '../../components/AddressList'
import {WingBlank, WhiteSpace} from "antd-mobile";
class SubmitDetail extends Component {
render() {
return (
<div>
111
<WhiteSpace/>
<WingBlank>
<AddressList/>
<AddressList data={[]}/>
</WingBlank>
</div>
......
......@@ -10,7 +10,7 @@ const Login = (props) => {
axiosRequest({
method: 'post',
url: '/dgbg/mobileLogin.view?userName=2012012099&clientFlag=123456&password=1',
url: '/idtAppServiceV6/oApp/login?userName=2012012099&clientFlag=123456&password=1',
}).then(res => {
!res.errorMessage && props.history.push(`/bord/backlog`)
// setOperates(res.operate || []);
......
......@@ -8,7 +8,7 @@ const Notice = (props) => {
const [loading, setLoading] = useState(false);
const [current, setCurrent] = useState(1);
const [searchWord, setSearchWord] = useState()
const [data, setData] = useState([{},{},{},{},{},{}]);
const [data, setData] = useState([]);
const getData = () => {
const pageMap ={searchWord, nowPage: current, pageSize: 10};
......@@ -16,10 +16,10 @@ const Notice = (props) => {
setLoading(true)
axiosRequest({
method: 'post',
url: '/dgbg/mobileGetOperates.view?userName=2012012099&clientFlag=123456',
url: '/dgbg/mobileGetWaitDealList.view?userName=2012012099&clientFlag=123456',
}).then(res => {
setLoading(false);
let result = data.concat([{}, {}, {}, {}, {}, {}])
let result = res.rows ?data.concat(res.rows) : data
setData(result)
setCurrent(current + 1)
});
......@@ -36,8 +36,8 @@ const Notice = (props) => {
}
};
useEffect(() => {
window.addEventListener('scroll', handleScroll, true);
return () => window.removeEventListener('scroll', handleScroll, true);
// window.addEventListener('scroll', handleScroll, true);
// return () => window.removeEventListener('scroll', handleScroll, true);
}, [data]);
const checkLog = () => {
......@@ -48,7 +48,18 @@ const Notice = (props) => {
useEffect(() => {
const element = document.getElementById('common-content')
element.scrollTo(0, 0)
}, [])
}, []);
//tab已读未读切换
const [tab, setTab] = useState('')
const tabChange = val => {
setTab(val)
console.log(val)
};
useEffect(() => {
getData()
}, [searchWord, tab])
return (
<WingBlank>
<ActivityIndicator
......@@ -57,7 +68,7 @@ const Notice = (props) => {
animating={loading}
/>
<WhiteSpace/>
<TopNotice onSearch={setSearchWord}/>
<TopNotice onSearch={setSearchWord} tabChange={tabChange}/>
{
data.map((item, index) => (
<div key={index}>
......
......@@ -8,6 +8,7 @@ const Work = (props) => {
const [loading, setLoading] = useState(false)
const [addStatus, setAddStatus] = useState(false);
const [operates, setOperates] = useState([]);
const [data, setData] = useState([])
useEffect(() => {
loadOperates();
......@@ -17,10 +18,12 @@ const Work = (props) => {
setLoading(true)
axiosRequest({
method: 'post',
url: '/dgbg/mobileGetOperates.view?userName=2012012099&clientFlag=123456',
url: '/idtAppServiceV6/oApp/getAllOperate',
}).then(res => {
setLoading(false)
setOperates(res.operate || []);
setLoading(false);
const result = res.operate ? res.operate.map(item => ({ icon: '', text: item.NODENAME })) : []
setOperates(result);
setData(result)
});
}
......@@ -29,7 +32,12 @@ const Work = (props) => {
};
const workSearch = (val) => {
console.log(val)
const result = operates.filter(item => item.text && item.text.toLowerCase().indexOf(val.toLowerCase()) > -1);
if (val !== null && val !== '') {
setData(result)
}else {
setData(operates)
}
};
const itemAdd = (id, arr, arr2) => {
......@@ -60,7 +68,7 @@ const Work = (props) => {
title="工作详情"
addCommon={ commonEdit }
addStatus={addStatus}
data={ operates.map(item => ({ icon: '', text: item.NODENAME }))}
data={data}
workUrl={workUrl}
iconAction={ itemAdd }
/>
......
......@@ -9,7 +9,7 @@ const WorkDetail = (props) => {
const [loading, setLoading] = useState(false);
const [current, setCurrent] = useState(1);
const [searchWord, setSearchWord] = useState()
const [data, setData] = useState([{},{},{},{},{},{}]);
const [data, setData] = useState([]);
const getData = () => {
const pageMap ={searchWord, nowPage: current, pageSize: 10};
......@@ -17,10 +17,10 @@ const WorkDetail = (props) => {
setLoading(true)
axiosRequest({
method: 'post',
url: '/dgbg/mobileGetOperates.view?userName=2012012099&clientFlag=123456',
url: '/idtAppServiceV6/getWaitDealList',
}).then(res => {
setLoading(false);
let result = data.concat([{}, {}, {}, {}, {}, {}])
let result = res.rows ? data.concat(res.rows) : data
setData(result)
setCurrent(current + 1)
});
......@@ -49,7 +49,18 @@ const WorkDetail = (props) => {
useEffect(() => {
const element = document.getElementById('work-content')
element.scrollTo(0, 0)
}, [])
}, []);
//tab已读未读切换
const [tab, setTab] = useState('')
const tabChange = val => {
setTab(val)
console.log(val)
};
useEffect(() => {
getData()
}, [searchWord, tab])
return (
<div id="work-content" className="work-content">
<WingBlank>
......@@ -59,7 +70,7 @@ const WorkDetail = (props) => {
animating={loading}
/>
<WhiteSpace/>
<TopNotice onSearch={setSearchWord}/>
<TopNotice onSearch={setSearchWord} tabChange={tabChange}/>
{
data.map((item, index) => (
<div key={index}>
......
......@@ -28,7 +28,7 @@ const ReactRouter = () => {
<CommonLayout>
<Route path="/bord/backlog" component={Backlog} />
<Route path="/bord/work" component={Work}/>
<Route path="/bord/communicate" component={Communicate}/>
<Route path="/bord/addressList/:id" component={Communicate}/>
<Route path="/bord/addressList" component={AddressList}/>
<Route path="/bord/notice" component={Notice}/>
</CommonLayout>
......
......@@ -3,7 +3,7 @@ import { stringify } from 'qs';
import { Toast } from 'antd-mobile';
const instance = axios.create();
const token = 'bearer ' + localStorage.getItem("token");
const token = localStorage.getItem("token");
let defaultHeaders = {
token,
......@@ -47,6 +47,7 @@ export const createAPI = (baseURL) => {
headers,
}, conf.opts))
.then(function (response) {
console.log(response)
if (!response || !response.data) { console.log('response出错, 无返回数据!', response); return false; };
if (response.data && response.data.errorMessage) {
......@@ -54,11 +55,12 @@ export const createAPI = (baseURL) => {
return false;
}
// 保存到本地
if (response && response.data && response.data.access_token) {
if (response && response.data && response.data.data && response.data.data.token) {
console.log(response.data.data.token)
defaultHeaders = {
token: 'bearer ' + response.data.access_token,
token: response.data.data.token,
}
localStorage.setItem("token", response.data.access_token);
localStorage.setItem("token", response.data.data.token);
}
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