Przeglądaj źródła

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

yichael 4 lat temu
rodzic
commit
e3978a9343
1 zmienionych plików z 395 dodań i 21 usunięć
  1. 395 21
      components/home/teacher/project.vue

+ 395 - 21
components/home/teacher/project.vue

@@ -32,8 +32,8 @@
 					<!-- <tbody class='table'> -->
 					<tbody>
 						<tr v-for="(item,index) in projectData" :key="index">
-						<!-- 	<t-table @change="change"> 
-							<t-tr> </t-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>
@@ -41,14 +41,14 @@
 							<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>{{item.ProjectName}}</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>
-							
+
 							<!-- <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>
@@ -92,6 +92,7 @@
 							<th>下载</th>
 							<th>删除</th>
 							<th>审核</th>
+							<th>审核状态</th>
 						</tr>
 					</thead>
 					<tbody>
@@ -101,9 +102,10 @@
 							<th>{{item.Type}}</th>
 							<th>{{item.UploadUserName}}</th>
 							<th>{{item.UPloadTime.substring(0,9)}}</th>
-							<th style="position: relative;"><button type="default" size="mini" @click="download(index)" class="m_edit">下载</button></th>
-							<th style="position: relative;"><button type="default" size="mini" @click="delete1(index)" class="m_delete">删除</button></th>
-							<th style="position: relative;"><button type="default" size="mini" @click="audit(item)" class="m_audit">审核</button></th>
+							<th style="position: relative;"><button type="default" size="mini" @click="download(index,item)" class="m_edit">下载</button></th>
+							<th style="position: relative;"><button type="default" size="mini" @click="deleteFile(index,item)" class="m_delete">删除</button></th>
+							<th style="position: relative;"><button type="default" size="mini" @click="audit(index,item)" class="m_audit">审核</button></th>
+							<th>{{getShenheText(item.Pass)}}</th>
 						</tr>
 					</tbody>
 				</table>
@@ -293,7 +295,69 @@
 
 		</view>
 
+		<!--上传文件对话框-->
+		<view class="m_msg" v-show="isShowAddFile">
+			<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"/>-->
+						<view class="addMember_input_box">
+							<input class="addMember_input" type="string" v-model="fileDialogData.name" placeholder="文件名字" />
+						</view>
+
+					</th>
+					<!--<th>-->
+					<!--<input class="uni-input" placeholder-style="color:#F76260" placeholder="类型"  v-model="editDialogData.type"/>-->
+					<!--</th>-->
+					<th>
+						<picker class="form-input" @change="bindPickerChange_fileType" :value="index_FileType" :range="addFileType">
+							<view class=" df fdr aic jcsb">
+								<view>{{addFileType[index_FileType]}}</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">
+				<!--<view class="addMember_btn df aic jcc" @click="addMemberData">添加</view>-->
+				<button type="default" size="mini" @click="addFileData(index)" class="m_edit">添加</button>
+				<button type="default" size="mini" @click="addFileDataCancel(index)" class="m_delete">取消</button>
+			</view>
 
+		</view>
 		<!-- <locationtemp ref="location_temp"></locationtemp> -->
 	</view>
 </template>
@@ -319,6 +383,7 @@
 				fileData: [],
 				projectMembers: [],
 				isShowAddMember: false,
+				isShowAddFile: false,
 				addedMemberModel: {
 					"IlabAccount": '',
 					"type": ''
@@ -330,8 +395,11 @@
 				editDialogData : {name : "", type :"", Introduction : ""},
 				proType: ['科幻', '现实', '剧情', '历史', '爱情', '惊悚', '公路', '动画'],
 				addproType: ['编剧', '摄影师' ,'录音师', '灯光师', '创建人'],
+				addFileType: ['剧本' ,'拍摄脚本' ,'分镜头脚本' ,'气氛图', '项目简介', '项目报告' ,'场景图'],
 				index_addproType : 0,
 				index_proType : 0,
+				index_FileType : 0,
+                fileDialogData : {name : "", type :""},
 			}
 		},
 		components: {
@@ -350,11 +418,21 @@
 				this.currentSelect = {section:0,buttonType:'edit',index:index};
 				console.log("修改什么", this.currentSelect);
 			},
+
+			//审核状态中文
+			getShenheText(pass){
+				let t = "成功"
+				if (pass == false) {
+					t = "失败"
+				}
+				return t
+			},
+
 			deleteProject(index) {
 				this.title = "是否删除信息?";
 				this.arr = ["删除", "取消"]
 				this.show = true;
-				
+
 				this.currentSelect = {section:0,buttonType:'delete',index:index};
 			},
 			// delete1(index) {
@@ -362,22 +440,31 @@
 			// 	this.arr = ["删除", "取消"]
 			// 	this.show = true;
 			// },
-			download(index) {
+			download(index,item) {
 				this.title = "下载成功?";
 				this.arr = ["确认"];
 				this.show = true;
+                this.currentSelect = {section:0,buttonType:'downloadIMG',index:index,item:item};
 			},
+            deleteFile(index,item) {
+                this.title = "是否删除文件?";
+                this.arr = ["删除", "取消"]
+                this.show = true;
+
+                this.currentSelect = {section:0,buttonType:'deleteFile',index:index,item:item};
+            },
 			// edit(index) {
 			// 	this.title = "是否删除信息?";
 			// 	this.arr = ["删除", "取消"]
 			// 	this.show = true;
 			// },
-			audit(index) {
+			audit(index,item) {
 				this.title = "是否确认审核?";
 				this.arr = ["通过", "未通过"]
 				this.show = true;
 				this.callback = "audit"
 				// this.auditshow = true;
+                this.currentSelect = {section:0,buttonType:'audit',index:index,item:item};
 			},
 			editSave() {
 				if (this.editDialogData.name == "") {
@@ -540,10 +627,96 @@
 									console.log("点了 取消修改", this.currentSelect);
 								}
 								break;
+							case 'downloadIMG':
+								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);
+
+                                    // this.currentSelect.item
+                                    this.DownloadFile()
+								}else if(obj == 1){
+									// this.editDialogData = {name : "", type :"", Introduction : ""}
+									console.log("点了 取消下载", this.currentSelect);
+								}
+								break;
+							case 'deleteFile':
+								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);
+
+                                    // this.currentSelect.item
+                                    this.delFile()
+								}else if(obj == 1){
+									// this.editDialogData = {name : "", type :"", Introduction : ""}
+									console.log("点了 取消删除", this.currentSelect);
+								}
+								break;
+							case 'audit':
+								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);
+
+                                    // this.currentSelect.item
+
+									let data = {
+										ProjectItemID: this.currentSelect.item,
+										Pass: true
+									}
+									this.auditPost(data);
+
+								}else if(obj == 1){
+									// this.editDialogData = {name : "", type :"", Introduction : ""}
+									console.log("点了 取消审核", this.currentSelect);
+									let data = {
+										ProjectItemID: this.currentSelect.item,
+										Pass: false
+									}
+									this.auditPost(data);
+								}
+								break;
 							default:
 								break;
 						}
-						
+
 						break;
 					default:
 						break;
@@ -552,16 +725,31 @@
 				// console.log(obj)
 			},
 			auditPost(obj) {
+				console.log("审核信息", obj.ProjectItemID.ProjectID);
+				let url = this.$Api + "/project/setfilepass"
+
+				// const data = {
+				// 			// 			ProjectItemID: "xxxx",
+				// 			// 			Pass: obj == 0
+				// 			// 		}
+				let data = {
+					"ProjectItemID" : obj.ProjectItemID.Id,
+					"Pass":obj.Pass,
+					}
+				console.log('审核 发送数据 '," 地址 ",url," 数据 ",data,"项目数据",this.projectData)
 				uni.request({
-					url: this.$Api + "/project/setfilepass",
-					data: obj,
+					url: url,
+					data: data,
 					method: "POST",
 					dataType: "json",
 					success: res => {
-						var {
-							data
-						} = res;
-						alert(data.msg);
+						console.log('审核 返回',res)
+						if (res.data.Code == 100) {
+							// this.$refs.table.getList();
+							// this.$forceUpdate()
+							// this.isShowAddMember = false
+							this.getFileList();
+						}
 					}
 				})
 			},
@@ -681,6 +869,104 @@
 				})
 
 			},
+
+			addFileData(){
+
+				// console.log("添加学生", this.addedMemberModel,this.projectData[0]);
+				// // "userID" : "12eqwed12",
+				// // "ProjectID":1,
+				// // "DeleteUserID":"12eqwe12"
+				// // userID User.Id
+				// // ProjectID this.projectData[0].Id,
+				//
+				// // "UserID" : "12eqwed12",    //项目创建人ID
+				// // "ProjectID": 10001,        //项目ID
+				// // "AddUserID":"12eqwe12"     //添加人员ID 支持ilabID UserID
+				// // "Type":"美术师"             //编剧 摄影师 录音师 灯光师 创建人
+				// if (this.addedMemberModel.IlabAccount == "") {
+				// 	alert("学员id不能为空")
+				// 	return
+				// }
+				//
+				//
+				// console.log('删掉成员 ')
+				//
+				// let url = this.$Api + "/project/addmember"
+				//
+				//
+				// let data = {
+				// 	"UserID" : this.projectData[0].CreateUserID,
+				// 	"ProjectID":this.projectData[0].Id,
+				// 	"AddUserID":this.addedMemberModel.IlabAccount,
+				// 	"Type":this.addedMemberModel.type,
+				// }
+				// console.log('添加成员 发送数据 '," 地址 ",url," 数据 ",data,"项目数据",this.projectData)
+				//
+				// uni.request({
+				// 	url: url,
+				// 	data: data,
+				// 	method: "POST",
+				// 	dataType: "json",
+				// 	success: res => {
+				// 		console.log('添加成员 返回',res)
+				// 		if (res.data.Code == 100) {
+				// 			// this.$refs.table.getList();
+				// 			this.$forceUpdate()
+				// 			this.isShowAddMember = false
+				// 		}
+				// 		this.getMemberList();
+				// 		this.$forceUpdate()
+				// 		this.isShowAddMember = false
+				// 		// this.projectData.splice(index,index);
+				// 	}
+				// })
+
+				// parameter:
+				// 		UserID:         //上传用户 id
+				// 		Name:           //文件名
+				// 		Type:           //规范文件 剧本 拍摄脚本 分镜头脚本 气氛图 项目简介 项目报告 场景图
+				// 		ProjectID:      //项目ID
+				// files:
+				// 		file:    文件
+
+                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.fileDialogData.name,
+                				"Type": this.fileDialogData.type,
+                				"ProjectID": this.projectData[0].Id,
+                			},
+                			success: (uploadFileRes) => {
+                				console.log('upload ok=', uploadFileRes.data);
+                                this.isShowAddFile = false
+                                this.fileDialogData = {name : "", type :""}
+                                this.getFileList();
+                				alert("创建成功");
+
+                				// this.model.projectName='';
+                				// this.model.describe='';
+                				// this.model.type='科幻';
+                				// this.$emit('onBackCreateInfo');
+
+                			}
+                		});
+                	}
+                });
+			},
+			addFileDataCancel(){
+				this.isShowAddFile = false
+			},
 			addMemberDataCancel(){
 				this.isShowAddMember = false;
 			},
@@ -708,6 +994,8 @@
 			},
 			onClick_addFile(){
 				console.log("项目 点了添加文件")
+				this.isShowAddFile = true
+
 			},
 			//删除条目
 			deleteItemProject(){
@@ -741,6 +1029,11 @@
 				this.addedMemberModel.type = this.addproType[this.index_addproType];
 				// console.log(this.model)
 			},
+            bindPickerChange_fileType: function(e) {
+                this.index_FileType = e.target.value;
+                this.fileDialogData.type = this.addFileType[this.index_FileType];
+                // console.log(this.model)
+            },
 			deleteMember(item){
 				// "userID" : "12eqwed12",
   				// "ProjectID":1,
@@ -774,7 +1067,88 @@
 						// this.projectData.splice(index,index);
 					}
 				})
-			}
+			},
+            delFile(){
+				// this.currentSelect
+				console.log('删除文件', this.currentSelect)
+				// SetFilePass
+				let url = this.$Api + "/project/deleteprojectcontent"
+				// "UserID":"xxxx",           //上传人或者项目创建人
+				// 		"ProjectItemID" : "123"
+				let data = {
+					"UserID" : this.projectData[0].CreateUserID,
+					"ProjectItemID":this.currentSelect.item.Id
+				}
+				console.log('删除文件 发送数据 '," 地址 ",url," 数据 ",data,"项目数据",this.projectData)
+
+				uni.request({
+					url: url,
+					data: data,
+					method: "POST",
+					dataType: "json",
+					success: res => {
+						console.log('删除文件 返回',res)
+						if (res.data.Code == 100) {
+							// this.$refs.table.getList();
+							// this.$forceUpdate()
+							// this.isShowAddMember = false
+							this.getFileList();
+						}
+						// this.getMemberList();
+						// this.$forceUpdate()
+						// this.isShowAddMember = false
+						// this.projectData.splice(index,index);
+					}
+				})
+            },
+            DownloadFile() {
+				window.location.href = this.currentSelect.item.URL;
+                // uni.downloadFile({
+                //     // url: 'http://192.168.0.200:8058/files/200200711.doc',//下载地址接口返回
+                //     url: this.currentSelect.item.URL,//下载地址接口返回
+                //     success: (data) => {
+                //         if (data.statusCode === 200) {
+                //                     uni.showToast({
+                //                         icon: 'none',
+                //                         mask: true,
+                //                         title: '下载成功' , //保存路径
+                //                         duration: 3000,
+                //                     });
+				//
+				//
+                //             //文件保存到本地
+                //             // uni.saveFile({
+                //             //     tempFilePath: data.tempFilePath, //临时路径
+                //             //     success: function(res) {
+                //             //         uni.showToast({
+                //             //             icon: 'none',
+                //             //             mask: true,
+                //             //             title: '文件已保存:' + res.savedFilePath, //保存路径
+                //             //             duration: 3000,
+                //             //         });
+                //             //         // setTimeout(() => {
+                //             //         //     //打开文档查看
+                //             //         //     uni.openDocument({
+                //             //         //         filePath: res.savedFilePath,
+                //             //         //         success: function(res) {
+                //             //         //             // console.log('打开文档成功');
+                //             //         //         }
+                //             //         //     });
+                //             //         // }, 3000)
+                //             //     }
+                //             // });
+                //         }
+                //     },
+                //     fail: (err) => {
+                //         console.log(err);
+                //         uni.showToast({
+                //             icon: 'none',
+                //             mask: true,
+                //             title: '失败请重新下载',
+                //         });
+                //     },
+                // });
+            },
 		}
 	}
 </script>
@@ -971,7 +1345,7 @@
 	.m_row_class {
 		margin-bottom: 60rpx;
 	}
-	
+
 	.addMember_box{
 		margin-bottom: 50rpx;
 		height: 80rpx;
@@ -1012,7 +1386,7 @@
 		border:1px solid black;
 	}
 	.input-item {
-		
+
 		// height: 110rpx;
 		// font-size: 40rpx;
 		// background: #000000;
@@ -1022,7 +1396,7 @@
 		// margin-right: 40rpx;
 		// color: #00F6FF;
 		// width: 50%;
-		
+
 		// display: flex;
 		// display: -webkit-flex;
 		// align-items:center;