yu 4 лет назад
Родитель
Сommit
b290e487c9
2 измененных файлов с 94 добавлено и 13 удалено
  1. 88 11
      components/home/teacher/project.vue
  2. 6 2
      components/home/teacherCreation.vue

+ 88 - 11
components/home/teacher/project.vue

@@ -29,6 +29,7 @@
 							<th>删除</th>
 						</tr>
 					</thead>
+					<!-- <tbody class='table'> -->
 					<tbody>
 						<tr v-for="(item,index) in projectData" :key="index">
 						<!-- 	<t-table @change="change"> 
@@ -43,11 +44,18 @@
 							
 							<th>{{item.ProjectName}}</th>
 							<th>{{item.Type}}</th>
-							<!-- <th>{{item.Describe}}</th> -->
 							<th>{{item.Type}}</th>
 							<th>{{item.CreateUserName}}</th>
 							<th style="position: relative;"><button type="default" size="mini" @click="editProject(index)" class="m_edit">修改</button></th>
 							<th style="position: relative;"><button type="default" size="mini" @click="deleteProject(index)" class="m_delete">删除</button></th>
+							
+							<!-- <th class='blank'><input type="text" :value='item.ProjectName' class='input-item'/></th>
+							<th class='blank'><input type="text" :value='item.Type' class='input-item'/></th>
+							<th class='blank'><input type="text" :value='item.Type' class='input-item'/></th>
+							<th class='blank'><input type="text" :value='item.CreateUserName' class='input-item'/></th>
+							<th style="position:relative;" class='blank'><button type="default" size="mini" @click="editProject(index)" class="m_edit">修改</button></th>
+							<th style="position:relative;" class='blank'><button type="default" size="mini" @click="deleteProject(index)" class="m_delete">删除</button></th>
+						 -->
 						</tr>
 					</tbody>
 				</table>
@@ -190,6 +198,8 @@
 					"IlabAccount": '',
 					"AddUserID": ''
 				},
+				currentSelect:{section:-1,buttonType:'',index:-1},
+				Type:'asd'
 			}
 		},
 		components: {
@@ -210,6 +220,8 @@
 				this.title = "是否删除信息?";
 				this.arr = ["删除", "取消"]
 				this.show = true;
+				
+				this.currentSelect = {section:0,buttonType:'delete',index:index};
 			},
 			// delete1(index) {
 			// 	this.title = "是否删除信息?";
@@ -236,18 +248,34 @@
 			determine(obj) {
 				this.show = false;
 				this.auditshow = false;
-				switch (this.callback) {
-					case "audit": //审核
-						const data = {
-							ProjectItemID: "xxxx",
-							Pass: obj == 0
+				// switch (this.callback) {
+				// 	case "audit": //审核
+				// 		const data = {
+				// 			ProjectItemID: "xxxx",
+				// 			Pass: obj == 0
+				// 		}
+				// 		this.auditPost(data);
+				// 		break;
+				// 	default:
+				// 		break;
+				// }
+				// this.currentSelect = {section:0,buttonType:'delete',index:index};
+				switch (this.currentSelect.section) {
+					case 0: //項目管理
+						switch (this.currentSelect.buttonType) {
+							case 'delete': 
+								
+								
+								break;
+							default:
+								break;
 						}
-						this.auditPost(data);
+						
 						break;
 					default:
 						break;
 				}
-
+				
 				// console.log(obj)
 			},
 			auditPost(obj) {
@@ -278,9 +306,9 @@
 				})
 			},
 			getFileList() {
-				console.log("用户id");
-				console.log(this.$UserId);
-				console.log(this.projectData[0].Id);
+				// console.log("用户id");
+				// console.log(this.$UserId);
+				// console.log(this.projectData[0].Id);
 				uni.request({
 					url: this.$Api + "/project/getprojectcontent",
 					data: {
@@ -345,6 +373,24 @@
 			},
 			onClick_addFile(){
 				
+			},
+			deleteProject(){
+				console.log('UserID=',this.$UserId)
+				console.log('ProjectID=',this.projectData[0].Id)
+				var temp = {
+					"UserID": this.$UserId, //项目创建人ID
+					"ProjectID": this.projectData[0].Id, //项目ID
+				}
+				uni.request({
+					url: this.$Api + "/backstage/deleteproject",
+					data: temp,
+					method: "POST",
+					dataType: "json",
+					success: res => {
+						console.log("delete project ok", res);
+						this.$emit('onBackToProjectList');
+					}
+				})
 			}
 		}
 	}
@@ -561,4 +607,35 @@
 		background: rgb(234, 37, 44);
 		color: rgb(255, 255, 255);
 	}
+	.blank{
+		// display: flex;
+		// align-items:center;
+		// justify-content:center;
+		border:1px solid black;
+	}
+	.table{
+		// display: flex;
+		// display: -webkit-flex;
+		// align-items:center;
+		// justify-content:center;
+		border:1px solid black;
+	}
+	.input-item {
+		
+		// height: 110rpx;
+		// font-size: 40rpx;
+		// background: #000000;
+		// text-align: center;
+		// border-radius: 5%;
+		// margin-left: 40rpx;
+		// margin-right: 40rpx;
+		// color: #00F6FF;
+		// width: 50%;
+		
+		// display: flex;
+		// display: -webkit-flex;
+		// align-items:center;
+		// justify-content:center;
+		border:1px solid black;
+	}
 </style>

+ 6 - 2
components/home/teacherCreation.vue

@@ -39,7 +39,7 @@
 			<teacher ref="teacher" v-show="index==1" @paging="paging"></teacher>
 			<create ref="create" v-show="index==3" v-on:onBackCreateInfo="onBackCreateInfo"></create>
 			<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" v-on:onBackToProjectList='onBackToProjectList'></project>
 			<location ref="location" v-show="index==2||index==4"></location>
 			<!-- </view> -->
 		</scroll-view>
@@ -132,7 +132,7 @@
 				});
 			},
 			viewProject(obj, index) {
-				console.log("查看项目", obj, index);
+				// console.log("查看项目", obj, index);
 				// this.menu[1].list[0].title = '项目' + (index + 1);
 				// this.checkMenu(this.menu[1].list[0], 1);
 				this.checkMenu({id:4}, 1);
@@ -140,6 +140,10 @@
 			},
 			onBackCreateInfo(){
 				this.index = 1;
+			},
+			onBackToProjectList(){
+				this.index = 2;
+				this.$refs.table.getList();
 			}
 		}
 	}