diff --git a/src/components/Meeting/WriteOnlyMeeting.css b/src/components/Meeting/WriteOnlyMeeting.css
index edb608f7333e22b486fa354f5ec39ad7e8bf1a75..f7e20663aef5a0a7fa9f47a40fc66a369f8f97ff 100644
--- a/src/components/Meeting/WriteOnlyMeeting.css
+++ b/src/components/Meeting/WriteOnlyMeeting.css
@@ -5,14 +5,13 @@
margin-right: 20px;
}
.wrapper{
- width:45%;
+ width:100%;
display:inline-block;
padding: 20px;
- box-shadow: 0 0 6px 3px #ccc;
vertical-align: top;
}
.div{
- padding: 5px;
+ padding: 10px;
}
.input{
width: 400px;
diff --git a/src/components/Meeting/WriteOnlyMeeting.js b/src/components/Meeting/WriteOnlyMeeting.js
index e547fad2c7a7af3024821d230c22277508c6c1b9..90c9deb73636e107401eebebb24443f5f9d60905 100644
--- a/src/components/Meeting/WriteOnlyMeeting.js
+++ b/src/components/Meeting/WriteOnlyMeeting.js
@@ -7,56 +7,58 @@ export default class WriteOnlyMeeting extends Component {
constructor(props) {
super(props);
this.state = {
- key:this.props.data.key,
- date:null,
- time:null,
- status:'已召开',
- meeting:this.props.data.meeting,
- people:null,
- role:'部门例会',
- text:null
+ infor:{
+ id:this.props.data.id,
+ date:null,
+ status:'已召开',
+ meeting:this.props.data.meeting,
+ people:null,
+ role:'部门例会',
+ text:null
+ },
+ show:false
};
this.submit = this.submit.bind(this);
- this.reset = this.reset.bind(this);
}
setRole(value) {
- this.setState({
- role:value
- })
+ const { infor } = this.state;
+ infor.role = value;
}
setPeople(ev) {
- this.setState({
- people:ev.target.value
- })
+ const { infor } = this.state;
+ infor.people = ev.target.value
}
setName(ev) {
- this.setState({
- meeting:ev.target.value
- })
+ const { infor } = this.state;
+ infor.meeting = ev.target.value;
}
setDate(date,dateString) {
+ const { infor } = this.state;
+ infor.date = dateString;
this.setState({
- date:dateString
+ show:true
})
}
setText(ev) {
let text = ev.target.value;
let text2 = text.replace(/\s/g,'
');
- this.setState({
- text:text2
- })
+ const { infor } = this.state;
+ infor.text = text2;
}
- setTime = (moment) => {
- this.setState({
- time:moment.format('LT')
- })
+ setTime = (time,timeString) => {
+ if (this.state.infor.date != null) {
+ const { infor } = this.state;
+ infor.date = this.state.infor.date + ' ' + timeString;
+ }else{
+ message.error('请先选择日期');
+ }
}
//更新table
submit() {
- let states = this.state;
+ let { infor } = this.state;
let val = true;
- for ( let x in states) {
- if (states[x] == null) {
+ for ( let x in infor) {
+ if (infor[x] == null) {
message.error('填写的内容不能为空');
val = false;
break;
@@ -66,25 +68,22 @@ export default class WriteOnlyMeeting extends Component {
this.props.dispatch({
type:'meeting/updateList',
payload:{
- meeting:this.state
+ meeting:infor
}
});
message.success("保存成功");
setTimeout(function () {
- this.props.closeTable();
+ this.props.closePullScreen();
}.bind(this),500);
}
}
- reset() {
- this.props.closeTable();
- }
render() {
return (
会议时间
this.setDate(date,dateString)}/>
-
+ {this.state.show && }
会议名称
@@ -110,13 +109,6 @@ export default class WriteOnlyMeeting extends Component {
-
)
}
diff --git a/src/index.html b/src/index.html
index 9ea0fb2860f86e8e6b412b3c482fcc1693f12a55..c4e8956a29f97b21278e27c05c6b40c7be78425b 100755
--- a/src/index.html
+++ b/src/index.html
@@ -15,13 +15,21 @@
// 全局变量,由服务端输出
var OAglobal = {
user: {
- // avatar: 'http://online.hfut.edu.cn/online_logo.png',
- avatar: 'default',
+ avatar: 'http://online.hfut.edu.cn/online_logo.png',
stuid: 201111111,
- name: '村上春树',
+ name: '曹善敏',
depart: 3,
role: 3
},
+ meetingRoles:[
+ {
+ key:1,value:'全员大会',text:'全员大会'
+ },{
+ key:2,value:'部门例会',text:'部门例会'
+ },{
+ key:3,value:'其他',text:'其他'
+ }
+ ],
currentPeriod: 11,
navList: [
{
@@ -40,15 +48,10 @@
link: 'report'
},
{
- key: 'setting',
- text: '设置',
- link: 'setting'
+ key: 'meeting',
+ text: '会议',
+ link: 'meeting'
}
- // {
- // key: 'meeting',
- // text: '会议',
- // link: 'meeting'
- // }
],
memberStatus: [
{
diff --git a/src/models/meeting.js b/src/models/meeting.js
index 3950e5c5071c20341ea1593055903f1b4e03e2a8..89737e72233b63ad33b3ab86c5057519a7d64b37 100644
--- a/src/models/meeting.js
+++ b/src/models/meeting.js
@@ -14,12 +14,14 @@ export default {
},
subscriptions: {
- setup({ dispatch, history }) {
+ setup({ dispatch, history ,payload }) {
history.listen(location => {
if (location.pathname === '/meeting') {
dispatch({
type: 'fetchAllMeeting',
- payload: {}
+ payload: {
+ depart:OAglobal.user.depart
+ }
});
}
});
@@ -29,7 +31,7 @@ export default {
effects: {
// 获取所有会议信息
*fetchAllMeeting({ payload }, { call, put }) {
- const { data } = yield call(queryMeeting);
+ const { data } = yield call(queryMeeting,parse(payload));
if (data) {
yield put({
type: 'querySuccess',
@@ -51,7 +53,7 @@ export default {
type: 'updateSuccess',
payload: payload
})
- }else {
+ } else {
yield put({
type: 'updateFailure'
})
@@ -70,7 +72,7 @@ export default {
type: 'queryFailure'
})
}
- }
+ },
},
reducers: {
querySuccess(state, action) {
@@ -87,8 +89,9 @@ export default {
updateSuccess(state , action) {
const meetingContent = action.payload;
+ console.log('meetingContent',meetingContent);
const data = state.data.map(item => {
- if (item.key == action.payload.meeting.key) {
+ if (item.id == action.payload.meeting.id) {
return { ...item, ...action.payload.meeting }
}
return item;
@@ -104,7 +107,7 @@ export default {
addSuccess(state , action) {
const data = action.payload;
let oldData = state.data;
- oldData.splice(0,0,data);
+ oldData.unshift(data);
const param = {
data:oldData,
shouldUpdate:true
diff --git a/src/routes/Meeting.js b/src/routes/Meeting.js
index 5af7086c7e29cbc12104cd19f1a751c4cabbf4f3..16ccaa9210a2a11627cfc865b17fadf049c1c5df 100644
--- a/src/routes/Meeting.js
+++ b/src/routes/Meeting.js
@@ -5,13 +5,19 @@ import Layout from '../components/Common/Layout.js';
import TabPage from '../components/Common/TabPage.js';
import MeetingPanel from '../components/Meeting/MeetingPanel.js';
import BuildMeeting from '../components/Meeting/BuildMeeting.js';
+import PullScreen from '../components/Common/PullScreen.js';
class Meeting extends Component {
constructor(props) {
super(props);
this.state = {
meeting:props.meeting.data,
- currentNav:2
+ currentNav:2,
+ pullScreen:{
+ isShow:false,
+ title:null,
+ content:null
+ }
}
}
@@ -20,13 +26,43 @@ class Meeting extends Component {
meeting: nextProps.meeting.data
});
}
+
+ showPullScreen = (pullScreen) => {
+ this.setState({
+ pullScreen :{
+ isShow:true,
+ title:pullScreen.title || '',
+ content:pullScreen.content
+ }
+ })
+ }
+ handlechange = () => {
+ this.props.dispatch({
+ type:'fetchAllMeeting',
+ payload:{
+ depart:OAglobal.user.depart
+ }
+ })
+ }
+ closePullScreen = () => {
+ this.setState({
+ pullScreen:{
+ isShow:false,
+ title:null,
+ content:null
+ }
+ })
+ }
+
render() {
const { user } = OAglobal;
+ // console.log('meeting',this.state.meeting);
const tabItems1 = [
{
text:'我的会议',
key:'done',
- content:
+ content:
},
{
text:'发起会议',
@@ -42,9 +78,16 @@ class Meeting extends Component {
}
];
const tabItems = user.role > 1 ? tabItems1:tabItems2;
+ const pullScreen = this.state.pullScreen;
return (
+
)
}
}
diff --git a/src/services/meeting.js b/src/services/meeting.js
index 0b0d73cf628b68f29cfaff4f5d9f8877485216ef..ce0f59563bb8015c3d7239b0319994ffa62ca1e6 100644
--- a/src/services/meeting.js
+++ b/src/services/meeting.js
@@ -1,13 +1,21 @@
import request from '../utils/request';
import qs from 'qs';
-export async function queryMeeting () {
- return request('/api/meeting')
+export async function queryMeeting (params) {
+ return request(`/api/meeting?${qs.stringify(params)}`,{
+ credentials:'include',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+ }
+ })
}
export async function updateMeeting (params) {
return request('/api/meeting/',{
- method: 'put',
+ method: 'post',
mode: 'cors',
credentials: 'include',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+ },
body: qs.stringify(params)
})
}
@@ -16,6 +24,9 @@ export async function addMeeting (params) {
method:'put',
mode:'cors',
credentials:'include',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+ },
body:qs.stringify(params)
})
-}
\ No newline at end of file
+}