瀏覽代碼

项目修改的部分 可以了

husky 4 年之前
父節點
當前提交
f2d75245ae

+ 278 - 14
components/home/teacher/project.vue

@@ -44,7 +44,7 @@
 							
 							<th>{{item.ProjectName}}</th>
 							<th>{{item.Type}}</th>
-							<th>{{item.Type}}</th>
+							<th>{{item.Describe}}</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>
@@ -169,6 +169,65 @@
 		</view>
 		<msg ref="msg" :title="title" @determine="determine" :btnArr="arr" v-show="show"></msg>
 		<audit ref="audit" v-show="auditshow" @determine="determine"></audit>
+		<!--修改对话框-->
+		<view class="m_msg" v-show="editDialogshow">
+			<table style="width: 100%;border: 1px solid #DDDDDD;border-collapse: collapse">
+				<thead class="m-table-hander">
+				<tr>
+					<th>名称</th>
+					<th>类型</th>
+					<th>介绍</th>
+				</tr>
+				</thead>
+				<!-- <tbody class='table'> -->
+				<tbody>
+				<tr>
+					<!-- 	<t-table @change="change">
+                        <t-tr> </t-tr>
+                        <t-tr>{{item.ProjectName}}</t-tr>
+                        <t-tr>{{item.Type}}</t-tr>
+                        <t-tr>{{item.Describe}}</t-tr>
+                        <t-tr>{{item.CreateUserName}}</t-tr>
+                        <t-tr style="position: relative;"><button type="default" size="mini" @click="edit(index)" class="m_edit">修改</button></t-tr>
+                        <t-tr style="position: relative;"><button type="default" size="mini" @click="delete1(index)" class="m_delete">删除</button></t-tr>
+                        </t-table> -->
+					<th>
+						<input class="uni-input" placeholder-style="color:#F76260" placeholder="名称"  v-model="editDialogData.name"/>
+
+					</th>
+					<!--<th>-->
+						<!--<input class="uni-input" placeholder-style="color:#F76260" placeholder="类型"  v-model="editDialogData.type"/>-->
+					<!--</th>-->
+					<th>
+						<picker class="form-input" @change="bindPickerChange_proType" :value="index_proType" :range="proType">
+							<view class=" df fdr aic jcsb">
+								<view>{{proType[index_proType]}}</view>
+								<view>
+									<img src="../../../assets/user/pic_user_03.png" />
+								</view>
+							</view>
+						</picker>
+					</th>
+					<th>
+						<input class="uni-input" placeholder-style="color:#F76260" placeholder="介绍"  v-model="editDialogData.Introduction"/>
+					</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>
+			<view class="layout">
+				<button type="default" size="mini" @click="editDialogDetermine(index)" class="m_edit">修改</button>
+				<button type="default" size="mini" @click="editDialogCancel(index)" class="m_delete">取消</button>
+			</view>
+
+		</view>
 		<!-- <locationtemp ref="location_temp"></locationtemp> -->
 	</view>
 </template>
@@ -199,7 +258,12 @@
 					"AddUserID": ''
 				},
 				currentSelect:{section:-1,buttonType:'',index:-1},
-				Type:'asd'
+				Type:'asd',
+				editDialogshow : false,
+
+				editDialogData : {name : "", type :"", Introduction : ""},
+				proType: ['科幻', '现实', '剧情', '历史', '爱情', '惊悚', '公路', '动画'],
+				index_proType : 0,
 			}
 		},
 		components: {
@@ -212,9 +276,11 @@
 				this.index = obj;
 			},
 			editProject(index) {
-				this.title = "是否删除信息?";
-				this.arr = ["删除", "取消"]
+				this.title = "是否修改信息?";
+				this.arr = ["修改", "取消"]
 				this.show = true;
+				this.currentSelect = {section:0,buttonType:'edit',index:index};
+				console.log("修改什么", this.currentSelect);
 			},
 			deleteProject(index) {
 				this.title = "是否删除信息?";
@@ -245,6 +311,114 @@
 				this.callback = "audit"
 				// this.auditshow = true;
 			},
+			editSave() {
+				if (this.editDialogData.name == "") {
+					alert("请输入项目名称~");
+					return false;
+				}
+				if (this.editDialogData.type == "") {
+					alert("请输入项目类型~");
+					return false;
+				}
+				if (this.editDialogData.Introduction == "") {
+					alert("请输入项目介绍~");
+					return false;
+				}
+				// 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.request({
+					url: this.$Api + "/project/changeprojectinfo",
+					data: {
+						"UserID":this.projectData[0].CreateUserID,
+						"ProjectID" : this.projectData[0].Id,
+						"ProjectName":this.editDialogData.name,
+						"Describe":this.editDialogData.Introduction,              // 项目描述
+						"Type":this.editDialogData.type
+					},
+					method: "POST",
+					dataType: "json",
+					success: res => {
+						console.log('是否成功',res)
+						if (res.data.Code == 100) {
+							// this.projectMembers = res.data.Users;
+							// console.log();
+							// this.$refs.table.getList();
+							this.getlist()
+							this.editDialogshow = false
+							// this.editProject(0)
+							// this.show = false;
+							return true;
+						}
+						// this.tabledata = res.data.Projects
+						// console.log('res=',this.tabledata)
+					}
+				})
+
+
+				// uni.chooseImage({
+				// 	success: (chooseImageRes) => {
+				// 		const tempFilePaths = chooseImageRes.tempFilePaths;
+				// 		uni.uploadFile({
+				// 			url: this.$Api+'/project/uploadprojectfile', //仅为示例,非真实的接口地址
+				// 			filePath: tempFilePaths[0],
+				// 			name: 'file',
+				// 			formData: {
+				// 				// UserID:         //上传用户 id
+				// 				// Name:           //文件名
+				// 				// Type:           //规范文件 剧本 拍摄脚本 分镜头脚本 气氛图 项目简介 项目报告 场景图
+				// 				// ProjectID:      //项目ID
+				//
+				// 				"UserID": this.projectData[0].CreateUserID,
+				// 				"Name": this.editDialogData.name,
+				// 				"Type": this.editDialogData.type,
+				// 				"ProjectID": this.projectData[0].Id,
+				// 			},
+				// 			success: (uploadFileRes) => {
+				// 				console.log('upload ok=', uploadFileRes.data);
+				// 				alert("创建成功");
+				// 				this.model.projectName='';
+				// 				this.model.describe='';
+				// 				this.model.type='科幻';
+				//
+				// 				this.$emit('onBackCreateInfo');
+				// 			}
+				// 		});
+				// 	}
+				// });
+			},
+
+
+			editDialogDetermine(){
+				this.editSave()
+
+
+			},
+			editDialogCancel(){
+				this.editDialogshow = false
+				this.editDialogData = {name : "", type :"", Introduction : ""}
+
+			},
+			// editDialogName(event){
+			// 	this.editDialogData.name = event.target.value
+			// },
+			// editDialogType(event){
+			// 	this.editDialogData.type = event.target.value
+			// },
+			// editDialogIntroduction(event){
+			// 	this.editDialogData.Introduction = event.target.value
+			// },
 			determine(obj) {
 				this.show = false;
 				this.auditshow = false;
@@ -260,12 +434,43 @@
 				// 		break;
 				// }
 				// this.currentSelect = {section:0,buttonType:'delete',index:index};
+
+				console.log("点了 对话框", obj);
 				switch (this.currentSelect.section) {
 					case 0: //項目管理
 						switch (this.currentSelect.buttonType) {
-							case 'delete': 
-								
-								
+							case 'delete':
+								console.log("点了 删除", this.currentSelect);
+								if (obj == 0) {
+									console.log("点了 确定删除", this.currentSelect);
+									this.deleteItemProject()
+								}else if(obj == 1){
+									console.log("点了 取消删除", this.currentSelect);
+								}
+
+
+								break;
+							case 'edit':
+								console.log("点了 修改", this.currentSelect);
+								if (obj == 0) {
+									console.log("点了 确定修改", this.currentSelect,this.projectData[0]);
+
+									// CreateTime: "2021-04-17 11:04:09"
+									// CreateUserID: "1e9c969f-8990-40f2-8a8c-ecbafc5720b2"
+									// CreateUserName: "李力新"
+									// Describe: "999"
+									// Id: 28
+									// ProjectName: "999"
+									// ProjectReviewImage: "http://communication-org-simulation.oss-cn-beijing.aliyuncs.com/project_28_timg.jpeg?Expires=1618634575&OSSAccessKeyId=LTAI4G4obJx7AiUgWThKBL47&Signature=az3xXUG%2F6lmxEBTmRtwZ%2FankjK8%3D"
+									// ReviewImageOss: "project_28_timg.jpeg"
+									// Type: "科幻"
+									this.editDialogData = {name : this.projectData[0].ProjectName, type :this.projectData[0].Type, Introduction : this.projectData[0].Describe}
+									this.editDialogshow = true
+									console.log("修改数据", this.editDialogData);
+								}else if(obj == 1){
+									this.editDialogData = {name : "", type :"", Introduction : ""}
+									console.log("点了 取消修改", this.currentSelect);
+								}
 								break;
 							default:
 								break;
@@ -275,7 +480,7 @@
 					default:
 						break;
 				}
-				
+				this.currentSelect = {section:-1,buttonType:'',index:-1}
 				// console.log(obj)
 			},
 			auditPost(obj) {
@@ -296,12 +501,19 @@
 				uni.request({
 					url: this.$Api + "/project/getprojectcontent",
 					data: {
-						"UserID": this.$UserId
+						"UserID": this.$UserId,
+						"ProjectID": this.projectData[0].Id
 					},
 					method: "POST",
 					dataType: "json",
 					success: res => {
-						this.projectData = res.data.Projects;
+						if (res.data.Code == 100) {
+							this.projectData[0] = null
+							this.projectData[0] = res.data.Project;
+							// ++this.projectData
+							this.$forceUpdate()
+						}
+						console.log("获取了什么样子的信息", this.projectData[0]);
 					}
 				})
 			},
@@ -324,6 +536,7 @@
 				})
 			},
 			viewProject(obj) {
+				console.log('进来的什么信息',obj)
 				this.projectData = [obj];
 				this.getFileList();
 				this.getMemberList();
@@ -374,12 +587,13 @@
 			onClick_addFile(){
 				
 			},
-			deleteProject(){
+			//删除条目
+			deleteItemProject(){
 				console.log('UserID=',this.$UserId)
 				console.log('ProjectID=',this.projectData[0].Id)
 				var temp = {
-					"UserID": this.$UserId, //项目创建人ID
-					"ProjectID": this.projectData[0].Id, //项目ID
+					"UserID":this.projectData[0].CreateUserID,
+					"ProjectID" : this.projectData[0].Id,
 				}
 				uni.request({
 					url: this.$Api + "/backstage/deleteproject",
@@ -389,9 +603,16 @@
 					success: res => {
 						console.log("delete project ok", res);
 						this.$emit('onBackToProjectList');
+						this.$forceUpdate();//强制刷新页面
 					}
 				})
-			}
+			},
+			bindPickerChange_proType: function(e) {
+				this.index_proType = e.target.value;
+				this.editDialogData.type = this.proType[this.index_proType];
+				// console.log(this.model)
+			},
+
 		}
 	}
 </script>
@@ -462,7 +683,15 @@
 		background: #FDEBEC;
 		// opacity: 0.08;
 	}
+	.form-input {
+		width: 100%;
+		border: 1px solid #ece8e8;
+		line-height: 50rpx;
+		font-size: 30rpx;
+		border-radius: 6rpx;
+		padding: 10rpx 40rpx;
 
+	}
 	.m-table-hander {
 		background-color: #FFF8F7;
 		height: 140rpx;
@@ -638,4 +867,39 @@
 		// justify-content:center;
 		border:1px solid black;
 	}
+	.m_msg {
+		width: 1500rpx;
+		 height: 900rpx;
+		padding: 0rpx 0 40rpx 0;
+		position: fixed;
+		top: 50%;
+		left: 50%;
+		border-radius: 10rpx;
+		transform: translate(-50%, -50%);
+		z-index: 100;
+		background-color: #fff;
+		opacity: 1;
+		.layout{
+			position: absolute;
+			left: 50%;
+			bottom: 2%;
+		}
+		.m_edit {
+			position: relative;
+			left: 20%;
+
+			transform: translate(-50%, -50%);
+			background: rgb(67, 127, 250);
+			color: rgb(255, 255, 255);
+			min-width: 130rpx;
+		}
+		.m_delete {
+			position: relative;
+			left: 50%;
+			min-width: 130rpx;
+			transform: translate(-50%, -50%);
+			background: rgb(234, 37, 44);
+			color: rgb(255, 255, 255);
+		}
+	}
 </style>

+ 1 - 1
components/home/teacher/table.vue

@@ -67,7 +67,7 @@
 					success: res => {
 						this.tabledata = res.data.Projects
 						// console.log("table页面请求所有项目",res);
-						// this.$forceUpdate();//强制刷新页面
+						this.$forceUpdate();//强制刷新页面
 					}
 				})
 			},

+ 4 - 1
components/home/teacherCreation.vue

@@ -92,10 +92,13 @@
 			project,
 			location
 		},
+		onLoad(){
+			// uni.$on('add', this.add)
+		},
 		methods: {
 		
 			checkMenu(obj, i) {
-					// console.log('index=',obj.id)
+					console.log('index=',obj.id)
 				this.index = obj.id;
 				if (i == 0) {
 					this.index = obj.id;

+ 22 - 2
components/startLearning/learningAndExperiment/ksxx_xxysy_sjkc/ksxx_xxysy_sjkc.vue

@@ -252,8 +252,28 @@
 				this.resetCurCheckedAnswer();
 			},
 			onClick_test_next() {
-				this.curQIndex++;
-				this.resetCurCheckedAnswer();
+				if (this.checkedAnswer() == true) {
+					this.curQIndex++;
+					this.resetCurCheckedAnswer();
+				}else{
+					alert("必须选择一个答案");
+				}
+			},
+
+			checkedAnswer(){
+				let count = 0
+				let countMax = this.curCheckedAnswer.length
+				for (let i = 0; i <this.curCheckedAnswer.length ; i++) {
+
+					if (this.curCheckedAnswer[i] == 0) {
+						count++
+					}
+				}
+				if (count == countMax ) {
+					return false
+				}else{
+					return true
+				}
 			},
 			onClick_test_finish() {
 				console.log("所有答案", this.allCheckedAnswer);

+ 26 - 2
components/startLearning/learningAndExperiment/ksxx_xxysy_ylrz/ksxx_xxysy_ylrz.vue

@@ -258,9 +258,33 @@
 				this.resetCurCheckedAnswer();
 			},
 			onClick_test_next() {
-				this.curQIndex++;
-				this.resetCurCheckedAnswer();
+				console.log("这道题选了什么", this.curCheckedAnswer);
+				if (this.checkedAnswer() == true) {
+					this.curQIndex++;
+					this.resetCurCheckedAnswer();
+				}else{
+					alert("必须选择一个答案");
+				}
+
 			},
+
+
+			checkedAnswer(){
+				let count = 0
+				let countMax = this.curCheckedAnswer.length
+				for (let i = 0; i <this.curCheckedAnswer.length ; i++) {
+
+					if (this.curCheckedAnswer[i] == 0) {
+						count++
+					}
+				}
+				if (count == countMax ) {
+					return false
+				}else{
+					return true
+				}
+			},
+
 			onClick_test_finish() {
 				console.log("所有答案", this.allCheckedAnswer);
 				//检验一下答案

+ 24 - 2
components/student/survey.vue

@@ -246,8 +246,30 @@
 				this.resetCurCheckedAnswer();
 			},
 			onClick_test_next() {
-				this.curQIndex++;
-				this.resetCurCheckedAnswer();
+
+				// console.log("这道题选了什么", this.curCheckedAnswer);
+				if (this.checkedAnswer() == true) {
+					this.curQIndex++;
+					this.resetCurCheckedAnswer();
+				}else{
+					alert("必须选择一个答案");
+				}
+			},
+
+			checkedAnswer(){
+				let count = 0
+				let countMax = this.curCheckedAnswer.length
+				for (let i = 0; i <this.curCheckedAnswer.length ; i++) {
+
+					if (this.curCheckedAnswer[i] == 0) {
+						count++
+					}
+				}
+				if (count == countMax ) {
+					return false
+				}else{
+					return true
+				}
 			},
 			onClick_test_finish() {
 				console.log("所有答案", this.allCheckedAnswer);

+ 1 - 0
components/student/table.vue

@@ -67,6 +67,7 @@
 					
 						this.tabledata = res.data.Projects
 						// console.log('res=',this.tabledata)
+						this.$forceUpdate();//强制刷新页面
 					}
 				})
 			},

+ 2 - 1
components/user/selfInfo.vue

@@ -312,6 +312,7 @@
 			}
 		},
 		onUploadAvatar(){
+			console.log("点我了吗")
 			uni.chooseFile({
 			    success: (chooseFileRes) => {
 			        const tempFilePaths = chooseFileRes.tempFilePaths;
@@ -332,7 +333,7 @@
 							    url: this.$Api + "/user/getuserinfo", //仅为示例,非真实的接口地址
 								method: 'POST',
 								data: {
-									'UserID':this.$UserId, 
+									'UserID':this.$UserId,
 								},
 								dataType: 'json',
 								success: (res) => {