Forráskód Böngészése

Merge branch 'master' of http://81.70.224.233:10080/yichael/ZhongChuang_front_2

yu 4 éve
szülő
commit
e4e7842857

+ 37 - 24
components/home/teacher/create.vue

@@ -44,7 +44,7 @@
 					createUserID: undefined,
 					createUserID: undefined,
 					projectName: "",
 					projectName: "",
 					describe: "",
 					describe: "",
-					type: "",
+					type: "科幻",
 				},
 				},
 				index_proType: 0,
 				index_proType: 0,
 
 
@@ -71,36 +71,49 @@
 					alert("请输入项目类型~");
 					alert("请输入项目类型~");
 					return false;
 					return false;
 				}
 				}
-				// debugger;
-				// var dataform = new FormData();
-				// dataform.append("createUserID", this.model.createUserID);
-				// dataform.append("projectName", this.model.projectName);
-				// dataform.append("type", this.model.type);
-				// dataform.append("describe", this.model.describe);
-				uni.request({
-					url: this.$Api + "/project/createprojectnew",
-					data: this.model,
-					method: "POST",
-					// dataType: "json",
-					success: res => {
-
-						console.log(res);
-						// var {
-						// 	data
-						// } = res;
-						// this.tabledata = res.Projects
-					},
-					fail: res => {
-						console.log(res);
+				// let data = {
+				// 	"CreateUserID":mydata_userInfo.UserID,
+				// 	"ProjectName":this.model.projectName,
+				// 	"Describe":this.model.describe,
+				// 	"Type":this.model.type
+				// }
+				// console.log("请求创建项目",data);
+				// MyRequest.CreateProjectNew(data,function(res){
+				// 	console.log("创建项目成功",res);
+				// },null);
+
+				console.log("创建项目自己ID",mydata_userInfo.UserID);
+				uni.chooseImage({
+					success: (chooseImageRes) => {
+						const tempFilePaths = chooseImageRes.tempFilePaths;
+						uni.uploadFile({
+							url: 'http://39.105.166.141:8085/project/createprojectnew', //仅为示例,非真实的接口地址
+							filePath: tempFilePaths[0],
+							name: 'file',
+							formData: {
+								"CreateUserID": mydata_userInfo.UserID,
+								// "CreateUserID":"1e9c969f-8990-40f2-8a8c-ecbafc5720b2",
+								"ProjectName": this.model.projectName,
+								"Describe": this.model.describe,
+								"Type": this.model.type
+							},
+							success: (uploadFileRes) => {
+								console.log('upload ok=', uploadFileRes.data);
+								alert("创建成功");
+								this.model.projectName='';
+								this.model.describe='';
+								this.model.type='科幻';
+							}
+						});
 					}
 					}
-				})
+				});
 			},
 			},
 			clear() {
 			clear() {
 				this.model = {
 				this.model = {
 					createUserID: undefined,
 					createUserID: undefined,
 					projectName: "",
 					projectName: "",
 					describe: "",
 					describe: "",
-					type: "",
+					type: "科幻",
 				}
 				}
 			},
 			},
 			bindPickerChange_proType: function(e) {
 			bindPickerChange_proType: function(e) {

+ 4 - 1
components/home/teacher/project.vue

@@ -8,7 +8,7 @@
 					<view class="m_row_link">
 					<view class="m_row_link">
 
 
 					</view>
 					</view>
-					<view class="m_row_title" v-text="'成员管理'">
+					<view class="m_row_title" v-text="'项目管理'">
 
 
 					</view>
 					</view>
 					<view style="position: relative;margin-left: 40rpx;">
 					<view style="position: relative;margin-left: 40rpx;">
@@ -279,6 +279,9 @@
 					}
 					}
 				})
 				})
 
 
+			},
+			viewProject(obj) {
+				this.projectData = [obj];
 			}
 			}
 		}
 		}
 	}
 	}

+ 10 - 7
components/home/teacher/table.vue

@@ -14,11 +14,11 @@
 				</thead>
 				</thead>
 				<tbody>
 				<tbody>
 					<tr v-for="(item,index) in tabledata" :key="index">
 					<tr v-for="(item,index) in tabledata" :key="index">
+						<th>{{'项目'+(index+1)}}</th>
 						<th>{{item.ProjectName}}</th>
 						<th>{{item.ProjectName}}</th>
-						<th></th>
-						<th></th>
+						<th>{{item.Type}}</th>
 						<th>{{item.CreateUserName}}</th>
 						<th>{{item.CreateUserName}}</th>
-						<th style="position: relative;"><button type="default" @click="find(item)" size="mini" class="m_delete">查看</button></th>
+						<th style="position: relative;"><button type="default" @click="find(item,index)" size="mini" class="m_delete">查看</button></th>
 					</tr>
 					</tr>
 				</tbody>
 				</tbody>
 			</table>
 			</table>
@@ -59,7 +59,8 @@
 				uni.request({
 				uni.request({
 					url: this.$Api + "/project/getprojects",
 					url: this.$Api + "/project/getprojects",
 					data: {
 					data: {
-						"UserID": this.$UserId
+						// "UserID": this.$UserId
+						"UserID": mydata_userInfo.UserID
 					},
 					},
 					method: "POST",
 					method: "POST",
 					dataType: "json",
 					dataType: "json",
@@ -67,12 +68,14 @@
 						var {
 						var {
 							data
 							data
 						} = res;
 						} = res;
-						this.tabledata = res.Projects
+						this.tabledata = res.data.Projects
+						console.log("table页面请求所有项目",res);
 					}
 					}
 				})
 				})
 			},
 			},
-			find(obj){
-				
+			//查看项目
+			find(obj,index){
+				this.$emit('viewProject',obj,index)
 			}
 			}
 		}
 		}
 	}
 	}

+ 16 - 8
components/home/teacherCreation.vue

@@ -30,14 +30,14 @@
 		</view>
 		</view>
 
 
 		<scroll-view class="rightBox" scroll-y="true" :scroll-top="scrollTop" @scroll="scroll">
 		<scroll-view class="rightBox" scroll-y="true" :scroll-top="scrollTop" @scroll="scroll">
-		<!-- <view class="rightBox"> -->
+			<!-- <view class="rightBox"> -->
 			<!-- showboder -->
 			<!-- showboder -->
 			<teacher ref="teacher" v-show="index==1" @paging="paging"></teacher>
 			<teacher ref="teacher" v-show="index==1" @paging="paging"></teacher>
 			<create ref="create" v-show="index==3"></create>
 			<create ref="create" v-show="index==3"></create>
-			<vtable ref="table" v-show="index==2"></vtable>
+			<vtable ref="table" v-show="index==2" v-on:viewProject='viewProject'></vtable>
 			<project ref="project" v-show="index==4"></project>
 			<project ref="project" v-show="index==4"></project>
 			<location ref="location" v-show="index==2||index==4"></location>
 			<location ref="location" v-show="index==2||index==4"></location>
-		<!-- </view> -->
+			<!-- </view> -->
 		</scroll-view>
 		</scroll-view>
 	</view>
 	</view>
 </template>
 </template>
@@ -69,7 +69,7 @@
 					title: '选择项目',
 					title: '选择项目',
 					list: [{
 					list: [{
 						id: 4,
 						id: 4,
-						title: "项目",
+						title: "项目",
 						select: false
 						select: false
 					}]
 					}]
 				}],
 				}],
@@ -100,7 +100,9 @@
 					obj.select = true;
 					obj.select = true;
 				}
 				}
 
 
-
+				if (obj.id == 2) {
+					this.$refs.table.getList();
+				}
 			},
 			},
 			paging(obj) {
 			paging(obj) {
 				this.index = obj;
 				this.index = obj;
@@ -119,6 +121,12 @@
 				this.$nextTick(() => {
 				this.$nextTick(() => {
 					this.scrollTop = 0
 					this.scrollTop = 0
 				});
 				});
+			},
+			viewProject(obj, index) {
+				console.log("查看项目", obj, index);
+				this.menu[1].list[0].title = '项目' + (index + 1);
+				this.checkMenu(this.menu[1].list[0],1);
+				this.$refs.project.viewProject(obj);
 			}
 			}
 		}
 		}
 	}
 	}
@@ -126,9 +134,9 @@
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">
 	@import '../../assets/icon/iconfont.css';
 	@import '../../assets/icon/iconfont.css';
-	
-	.rightBox{
-		flex:1;
+
+	.rightBox {
+		flex: 1;
 	}
 	}
 
 
 	.m_menu_right {
 	.m_menu_right {

+ 1 - 1
components/user/user.vue

@@ -189,7 +189,7 @@
 						let data = res.data;
 						let data = res.data;
 						//100成功
 						//100成功
 						if (data.Code == 100) {
 						if (data.Code == 100) {
-							console.log("请求成功", res);
+							// console.log("请求成功", res);
 							this.$refs.GRXX.updateInfo(data.User);
 							this.$refs.GRXX.updateInfo(data.User);
 							mydata_userInfo.email = data.User.Email;
 							mydata_userInfo.email = data.User.Email;
 							// console.log('00000000000=',mydata_userInfo.role)
 							// console.log('00000000000=',mydata_userInfo.role)

+ 2 - 2
components/user/userController.js

@@ -39,14 +39,14 @@ userController = {
 	updateUserInfo:function(){
 	updateUserInfo:function(){
 		MyRequest.GetUserInfo(function(res) {
 		MyRequest.GetUserInfo(function(res) {
 			userController.userInfo = res.data.User;
 			userController.userInfo = res.data.User;
-			console.log("请求用户信息",userController.userInfo);
+			// console.log("请求用户信息",userController.userInfo);
 		}, null);
 		}, null);
 	},
 	},
 	//老师
 	//老师
 	studentList:null,
 	studentList:null,
 	updateStudentList:function(suc,fail){
 	updateStudentList:function(suc,fail){
 		MyRequest.GetStudentList(function(res) {
 		MyRequest.GetStudentList(function(res) {
-			console.log("请求学生列表",res);
+			// console.log("请求学生列表",res);
 			userController.studentList = res.data.Students;
 			userController.studentList = res.data.Students;
 			if(suc){
 			if(suc){
 				suc();
 				suc();

+ 20 - 0
pages/home.vue

@@ -164,6 +164,26 @@
 				console.log("登陆成功home");
 				console.log("登陆成功home");
 				this.$refs.TopMenu.switchLoginState(true);
 				this.$refs.TopMenu.switchLoginState(true);
 				this.showPage(4);
 				this.showPage(4);
+
+				// uni.chooseImage({
+				// 	success: (chooseImageRes) => {
+				// 		const tempFilePaths = chooseImageRes.tempFilePaths;
+				// 		uni.uploadFile({
+				// 			url: 'http://39.105.166.141:8085/project/createprojectnew', //仅为示例,非真实的接口地址
+				// 			filePath: tempFilePaths[0],
+				// 			name: 'file',
+				// 			formData: {
+				// 				'CreateUserID': 'lyy22', // 创建用户 id
+				// 				'ProjectName': 'test22', // 项目名称
+				// 				'Describe': 'aaa22', // 项目描述
+				// 				'Type': 'bbbbb22', // 科幻 现实 历史 主旋律 纪录片
+				// 			},
+				// 			success: (uploadFileRes) => {
+				// 				console.log('upload ok=', uploadFileRes.data);
+				// 			}
+				// 		});
+				// 	}
+				// });
 			},
 			},
 			showPage(index) {
 			showPage(index) {
 				this.curShowPage = index;
 				this.curShowPage = index;

+ 6 - 0
request.js

@@ -77,5 +77,11 @@ MyRequest = {
 		};
 		};
 		// console.log("设置身份", data);
 		// console.log("设置身份", data);
 		this.uniRquest('/user/setusertype', data, suc, fail);
 		this.uniRquest('/user/setusertype', data, suc, fail);
+	},
+	CreateProjectNew(data, suc, fail) {
+		this.uniRquest('/project/createprojectnew', data, suc, fail);
+	},
+	GetProjects(data, suc, fail) {
+		this.uniRquest('/project/getprojects', data, suc, fail);
 	}
 	}
 }
 }