|
@@ -33,13 +33,13 @@
|
|
|
</thead>
|
|
</thead>
|
|
|
<tbody>
|
|
<tbody>
|
|
|
<tr v-for="(item,index) in projectData" :key="index">
|
|
<tr v-for="(item,index) in projectData" :key="index">
|
|
|
|
|
+ <th>{{item.Id}}</th>
|
|
|
<th>{{item.ProjectName}}</th>
|
|
<th>{{item.ProjectName}}</th>
|
|
|
- <th>{{item.ProjectName}}</th>
|
|
|
|
|
- <th>类型</th>
|
|
|
|
|
- <th>介绍</th>
|
|
|
|
|
- <th>进度</th>
|
|
|
|
|
- <th class="m_yl"><button type="default" size="mini" class="m_edit">预览</button></th>
|
|
|
|
|
- <th style="position: relative;"><button type="default" @click="projectRemove(item)" size="mini" class="m_delete">删除</button></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>
|
|
</tr>
|
|
|
</tbody>
|
|
</tbody>
|
|
|
</table>
|
|
</table>
|
|
@@ -57,27 +57,132 @@
|
|
|
projectData: []
|
|
projectData: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- created() {
|
|
|
|
|
- this.getlist();
|
|
|
|
|
- },
|
|
|
|
|
|
|
+
|
|
|
methods: {
|
|
methods: {
|
|
|
- getlist() {
|
|
|
|
|
|
|
+ init(){
|
|
|
|
|
+ console.log('simulationCore init');
|
|
|
|
|
+ // 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':'1e9c969f-8990-40f2-8a8c-ecbafc5720b2', // 创建用户 id
|
|
|
|
|
+ // 'ProjectName':'test22', // 项目名称
|
|
|
|
|
+ // 'Describe':'aaa22', // 项目描述
|
|
|
|
|
+ // 'Type':'bbbbb22', // 科幻 现实 历史 主旋律 纪录片
|
|
|
|
|
+ // },
|
|
|
|
|
+ // success: (uploadFileRes) => {
|
|
|
|
|
+ // console.log('upload ok=',uploadFileRes.data);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ this.getProjectsID();
|
|
|
|
|
+ },
|
|
|
|
|
+ getProjectsID() {
|
|
|
|
|
+ // console.log('userID=',this.$UserId)
|
|
|
uni.request({
|
|
uni.request({
|
|
|
- url: this.$Api + "/project/getprojectcontent",
|
|
|
|
|
|
|
+ url: this.$Api + "/project/getprojects",
|
|
|
data: {
|
|
data: {
|
|
|
"UserID": this.$UserId
|
|
"UserID": this.$UserId
|
|
|
},
|
|
},
|
|
|
method: "POST",
|
|
method: "POST",
|
|
|
dataType: "json",
|
|
dataType: "json",
|
|
|
success: res => {
|
|
success: res => {
|
|
|
- var {
|
|
|
|
|
- data
|
|
|
|
|
- } = res;
|
|
|
|
|
- this.projectData = data.Project;
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // console.log('res=',res)
|
|
|
|
|
+ // 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.File = [];
|
|
|
|
|
+ data.Member = [];
|
|
|
|
|
+ this.projectData.push(data);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for(let i=0;i<this.projectData.length;i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ this.getProjectsCtcontent(i);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ getProjectsCtcontent(index) {
|
|
|
|
|
+ // console.log('UserID=',this.$UserId)
|
|
|
|
|
+ // console.log('ProjectID=',this.projectData[index].Id)
|
|
|
|
|
+ uni.request({
|
|
|
|
|
+ url: this.$Api + "/project/getprojectcontent",
|
|
|
|
|
+ data: {
|
|
|
|
|
+ "UserID": this.$UserId,
|
|
|
|
|
+ "ProjectID": this.projectData[index].Id
|
|
|
|
|
+ },
|
|
|
|
|
+ method: "POST",
|
|
|
|
|
+ dataType: "json",
|
|
|
|
|
+ success: res => {
|
|
|
|
|
+ // console.log('res=',res)
|
|
|
|
|
+ this.projectData[index].Type = res.data.ProjectItem.Type;
|
|
|
|
|
+ this.getMember(index);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ getMember(index) {
|
|
|
|
|
+ uni.request({
|
|
|
|
|
+ url: this.$Api + "/project/getmember",
|
|
|
|
|
+ data: {
|
|
|
|
|
+ "ProjectID": this.projectData[index].Id
|
|
|
|
|
+ },
|
|
|
|
|
+ method: "POST",
|
|
|
|
|
+ dataType: "json",
|
|
|
|
|
+ success: res => {
|
|
|
|
|
+ // console.log('res=',res)
|
|
|
|
|
+ // console.log('Projects=',res.data.Users[0].User.Id)
|
|
|
|
|
+ for(let i=0;i<res.data.Users.length;i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ console.log('Projects=',res.data.Users[i].User.Id)
|
|
|
|
|
+ this.projectData[index].Member.push(res.data.Users[i].User.Id);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ preview(item){
|
|
|
|
|
+ uni.downloadFile({
|
|
|
|
|
+ url: item.File,
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ if (res.statusCode === 200) {
|
|
|
|
|
+ uni.openDocument({
|
|
|
|
|
+ filePath: res.tempFilePath,
|
|
|
|
|
+ // 如果文件名包含中文,建议使用escape(res.tempFilePath)转码,防止ios和安卓客户端导致的差异
|
|
|
|
|
+ success: function(res) {
|
|
|
|
|
+ console.log('打开文档成功');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ deleteMember(item){
|
|
|
|
|
+ uni.request({
|
|
|
|
|
+ url: this.$Api + "/project/deletemember",
|
|
|
|
|
+ data: {
|
|
|
|
|
+ "userID" : this.$UserId,
|
|
|
|
|
+ "DeleteUserID":item.Id
|
|
|
|
|
+ },
|
|
|
|
|
+ method: "POST",
|
|
|
|
|
+ dataType: "json",
|
|
|
|
|
+ success: res => {
|
|
|
|
|
+ console.log('res=',res)
|
|
|
|
|
+ // this.projectData.splice(index,index);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|