yu 4 лет назад
Родитель
Сommit
29d3d2f6ef
1 измененных файлов с 31 добавлено и 30 удалено
  1. 31 30
      components/home/simulationCore.vue

+ 31 - 30
components/home/simulationCore.vue

@@ -26,7 +26,6 @@
 							<th>名称</th>
 							<th>类型</th>
 							<th>介绍</th>
-							<th>进度</th>
 							<th>项目文件</th>
 							<th>项目成员</th>
 						</tr>
@@ -37,7 +36,6 @@
 							<th>{{item.ProjectName}}</th>
 							<th>{{item.Type}}</th>
 							<th>{{item.Intro}}</th>
-							<th>{{item.Progress}}</th>
 							<th class="m_yl"><button type="default" size="mini" class="m_edit" @click="preview(item)">预览</button></th>
 							<th style="position: relative;"><button type="default" @click="deleteMember(item)" size="mini" class="m_delete">删除</button></th>
 						</tr>
@@ -61,26 +59,26 @@
 		methods: {
 			init(){
 				console.log('simulationCore init');
-				uni.chooseImage({
-				    success: (chooseImageRes) => {
-				        const tempFilePaths = chooseImageRes.tempFilePaths;
-				        uni.uploadFile({
-				            url: this.$Api + "/project/createprojectnew", //仅为示例,非真实的接口地址
-				            filePath: tempFilePaths[0],
-				            name: 'file',
-				            formData: {
-								'CreateUserID':'1e9c969f-8990-40f2-8a8c-ecbafc5720b2',                // 创建用户 id
-								'ProjectName':'11',           // 项目名称
-								'Describe':'11',              // 项目描述
-								'Type':'11',                 // 科幻 现实 历史 主旋律 纪录片
-				            },
-				            success: (uploadFileRes) => {
-				                console.log('upload ok=',uploadFileRes.data);
-				            }
-				        });
-				    }
-				});
-				// this.getProjectsID();
+				// uni.chooseFile({
+				//     success: (chooseImageRes) => {
+				//         const tempFilePaths = chooseImageRes.tempFilePaths;
+				//         uni.uploadFile({
+				//             url: this.$Api + "/project/uploadprojectfile", //仅为示例,非真实的接口地址
+				//             filePath: tempFilePaths[0],
+				//             name: 'file',
+				//             formData: {
+				// 				'UserID':'1e9c969f-8990-40f2-8a8c-ecbafc5720b2',                // 创建用户 id
+				// 				'Name':'11',           // 项目名称
+				// 				'Type':'11',              // 项目描述
+				// 				'ProjectID':'2',                 // 科幻 现实 历史 主旋律 纪录片
+				//             },
+				//             success: (uploadFileRes) => {
+				//                 console.log('upload ok=',uploadFileRes.data);
+				//             }
+				//         });
+				//     }
+				// });
+				this.getProjectsID();
 			},
 			getProjectsID() {
 				// console.log('userID=',this.$UserId)
@@ -93,16 +91,15 @@
 					dataType: "json",
 					success: res => {
 						// console.log('res=',res)
-						// console.log('Projects=',res.data.Projects)
+						console.log('Projects=',res.data.Projects)
 						let Projects = res.data.Projects;
 						for(let i=0;i<Projects.length;i++)
 						{
 							let data = {};
 							data.Id = Projects[i].Id;
 							data.ProjectName = Projects[i].ProjectName;
-							data.Type = '后台缺';
-							data.Intro = '后台缺';
-							data.Progress = '后台缺';
+							data.Type = Projects[i].Type;
+							data.Intro = '';
 							data.File = [];
 							data.Member = [];
 							this.projectData.push(data);
@@ -114,12 +111,11 @@
 						}
 					}
 				})
-				
-				
 			},
 			getProjectsCtcontent(index) {
 				// console.log('UserID=',this.$UserId)
 				// console.log('ProjectID=',this.projectData[index].Id)
+			
 				uni.request({
 					url: this.$Api + "/project/getprojectcontent",
 					data: {
@@ -129,8 +125,13 @@
 					method: "POST",
 					dataType: "json",
 					success: res => {
-						// console.log('res=',res)
-						this.projectData[index].Type = res.data.ProjectItem.Type;
+						console.log('res=',res)
+						if(res.data.ProjectItem.length!=0)
+						{
+							this.projectData[index].Intro = res.data.ProjectItem[0].Type;
+							this.projectData[index].File = res.data.ProjectItem[0].URL;
+						}
+						
 						this.getMember(index);
 					}
 				})