Browse Source

新增文件夹/保存历史文件

master
revive 4 years ago
parent
commit
98601efe03
4 changed files with 194 additions and 100 deletions
  1. +1
    -0
      src/utils/request.js
  2. +7
    -0
      src/views/main_web/workspace/service.js
  3. +185
    -99
      src/views/main_web/workspace/workspace.vue
  4. +1
    -1
      vue.config.js

+ 1
- 0
src/utils/request.js View File

@@ -114,6 +114,7 @@ function mapApiPathToFullPath(path) {
case "project/CreateProject":
case "project/EditProject":
case "project/assignedWork":
case "file/AddArchMilesStone":
// case 'template/deleteTemplateNodeModelFile':
method = 'POST';


+ 7
- 0
src/views/main_web/workspace/service.js View File

@@ -26,4 +26,11 @@ export async function fetchFolderFileList(folderId, userId) {
export async function createSubFolder(folderGroupData) {
const res = await fetchApi('folder/createSubfolder', folderGroupData);
return wrapErrorHint(res);
}
/**
* 添加历史文件
*/
export async function AddArchMilesStone(fileInfo){
const res = await fetchApi('file/AddArchMilesStone', fileInfo);
return wrapErrorHint(res);
}

+ 185
- 99
src/views/main_web/workspace/workspace.vue View File

@@ -3086,6 +3086,7 @@ export default {
this.dbClickSelectedFolderGroupData != null &&
JSON.stringify(this.dbClickSelectedFolderGroupData) != "{}"
) {
console.log("我要更新当前文件夹啦");
this.intoFoldergroup(this.dbClickSelectedFolderGroupData);
} else {
this.listFiles();
@@ -5261,11 +5262,12 @@ export default {
/**
* 保存历史文件
*/
createMilestone: function (file) {
if (this.isCreating) {
async createMilestone(file){
if(this.isCreating){
return;
}
if (file.status == 1 && file.modifyUserID != sessionStorage.userId) {
/** 当共享且其他人在编辑时 */
if(file.Status ==2 && file.ModifyUserId !==sessionStorage.userId){
this.$notify({
title: "温馨提示",
message: "其他人编辑中,不能设置历史文件",
@@ -5273,52 +5275,90 @@ export default {
offset: 100,
duration: 5000,
});
return;
return;
}
this.isCreating = true;
var thisApp = this;
this.$axios({
method: "get",
url: encodeURI(
process.env.API_HOST +
"archives/milestone/" +
file.archID +
"/" +
sessionStorage.userId +
"/" +
this.dbClickSelectedFolderGroupData.folderGroupID
),
data: {
archid: file.archID,
userid: sessionStorage.userId,
foldergroupid: this.dbClickSelectedFolderGroupData.folderGroupID,
},
})
.then((response) => {
if (response.data.state == 1) {
thisApp.refreshPages();
this.$notify({
title: "恭喜您",
message: response.data.message,
type: "success",
offset: 100,
duration: 2500,
});
thisApp.isCreating = false;
} else {
this.$notify({
title: "温馨提示",
message: response.data.message,
type: "error",
offset: 100,
duration: 5000,
});
}
})
.catch((error) => {
console.log(error);
file.ModifyUserId=sessionStorage.userId;
file.ModifyTime=new Date();
const Res = await services.AddArchMilesStone(file);
if(Res.Code !=-1){
this.refreshPages();
this.$notify({
title: "恭喜您",
message: "成功保存历史文件",
type: "success",
offset: 100,
duration: 2500,
});
this.isCreating = false;
}else{
this.$notify({
title: "温馨提示",
message: Res.Msg,
type: "error",
offset: 100,
duration: 5000,
});
}
},
// createMilestone: function (file) {
// if (this.isCreating) {
// return;
// }
// if (file.status == 1 && file.modifyUserID != sessionStorage.userId) {
// this.$notify({
// title: "温馨提示",
// message: "其他人编辑中,不能设置历史文件",
// type: "warning",
// offset: 100,
// duration: 5000,
// });
// return;
// }
// this.isCreating = true;
// var thisApp = this;
// this.$axios({
// method: "get",
// url: encodeURI(
// process.env.API_HOST +
// "archives/milestone/" +
// file.archID +
// "/" +
// sessionStorage.userId +
// "/" +
// this.dbClickSelectedFolderGroupData.folderGroupID
// ),
// data: {
// archid: file.archID,
// userid: sessionStorage.userId,
// foldergroupid: this.dbClickSelectedFolderGroupData.folderGroupID,
// },
// })
// .then((response) => {
// if (response.data.state == 1) {
// thisApp.refreshPages();
// this.$notify({
// title: "恭喜您",
// message: response.data.message,
// type: "success",
// offset: 100,
// duration: 2500,
// });
// thisApp.isCreating = false;
// } else {
// this.$notify({
// title: "温馨提示",
// message: response.data.message,
// type: "error",
// offset: 100,
// duration: 5000,
// });
// }
// })
// .catch((error) => {
// console.log(error);
// });
// },
/**
* 获取历史文件记录
*/
@@ -6467,8 +6507,7 @@ export default {
this.folderGroupData={
Id:sessionStorage.userId,
ProjId:sessionStorage.projId,
SuperId:this.nowFolder.id,
LevelId:this.nowFolder.levelId,
//SuperId:this.nowFolder.id,//this.dbClickSelectedFolderGroupData.id,//this.nowFolder.id,
FirstFolderId:this.nowFolder.firstFolderId,
FolderName:this.folderGroupData.FolderName,
TemplateId:this.nowFolder.templateId,
@@ -6481,8 +6520,14 @@ export default {
CreateTime:new Date(),
ModifyUserId:sessionStorage.userId,
ModifyTime:new Date(),
}
console.log(this.folderGroupData);
}
if(this.dbClickSelectedFolderGroupData.Id){
this.folderGroupData.SuperId=this.dbClickSelectedFolderGroupData.Id;
}else{
this.folderGroupData.SuperId=this.nowFolder.id
}
console.log("新建文件夹2的信息");
console.log(this.folderGroupData);
const Res = await services.createSubFolder(this.folderGroupData);
if (Res.Code != -1) {
this.refreshPages();
@@ -6567,58 +6612,99 @@ export default {
/**
* 双击文件夹组名称 进入文件夹
*/
intoFoldergroup: function (foldergroup) {
// console.log('intoFoldergroup: ', foldergroup);
if (foldergroup == null || JSON.stringify(foldergroup) == "{}") {
this.$notify({
title: "温馨提示",
message: "请选中文件或新建文件夹",
type: "info",
offset: 100,
duration: 2500,
});
return;
async intoFoldergroup(foldergroup){
console.log("当前双击进入的文件的信息"+this.dbClickSelectedFolderGroupData.Id)
this.dbClickSelectedFolderGroupData=foldergroup;
this.isShowWorkt=false;
this.isShowBread=true;
const userId = this.userId;
const nowFolder=this.dbClickSelectedFolderGroupData;
const res = await services.fetchFolderFileList(nowFolder.Id,userId);
if(res.Code !==0) return;
const folderResInfo = (res.Data || {});
const folderFileList = this.folderFileList={
listAllFiles:null,
listBreadFolderGroups:folderResInfo.listBreadFolderGroups,
//我的文件
listFolderGroups: folderResInfo.folder,
listMyFiles: folderResInfo.myFile,
// 工作文件
listOtherFiles: folderResInfo.workFile,
listOtherFolderGroups: null,
}
this.dbClickSelectedFolderGroupData = foldergroup;
this.isShowWorkt = false;
this.isShowBread = true;
var param = {
folderId: foldergroup.Id,
foldergroupId: foldergroup.FirstFolderId,
levelId: foldergroup.LevelId,
userId: sessionStorage.userId,
};
this.$axios({
method: "get",
url: encodeURI(
process.env.API_HOST + "folders/foldergroup/intofoldergroup"
),
params: param,
}).then((response) => {
if (response.data.state == 1) {
//如果是我的文件下的文件和文件组 :0;否则是工作文件下的文件和文件组 :1
if (this.currentPageType == 0) {
// 加载我的文件
this.myFilesList = response.data.data.listMyFiles;
//zxm+ 加载我的文件夹组
this.myListFolderGroups = response.data.data.listFolderGroups;
//zxm+ 加载文件分组面包屑
this.folderGroupBreads = response.data.data.listBreadFolderGroups;
} else {
// 加载我的文件
this.myFilesList = response.data.data.listOtherFiles;
//zxm+ 加载我的文件夹组
this.myListFolderGroups = response.data.data.listOtherFolderGroups;
//zxm+ 加载文件分组面包屑
this.folderGroupBreads = response.data.data.listBreadFolderGroups;
}
clearInterval(this.timer);
this.timer = setInterval(() => {
this.intoFoldergroup(foldergroup);
}, 3 * 1000);
}
});
console.log("当前进入的文件的信息2:")
console.log(res);
if (this.currentPageType == 0) {
// 加载我的文件
this.myFilesList = this.folderFileList.listMyFiles;
// 加载我的文件夹 zxm+
this.myListFolderGroups = this.folderFileList.listFolderGroups;
this.folderGroupBreads =this.folderFileList.folderGroupBreads;
} else {
// 加载工作文件
this.myFilesList = this.folderFileList.listOtherFiles;
// 加载工作文件分组 zxm+
this.myListFolderGroups = this.folderFileList.listOtherFolderGroups;
this.folderGroupBreads =this.folderFileList.folderGroupBreads;
}
clearInterval(this.timer);
this.timer = setInterval(() => {
this.intoFoldergroup(foldergroup);
}, 8 * 1000);
},
// intoFoldergroup: function (foldergroup) {
// // console.log('intoFoldergroup: ', foldergroup);
// if (foldergroup == null || JSON.stringify(foldergroup) == "{}") {
// this.$notify({
// title: "温馨提示",
// message: "请选中文件或新建文件夹",
// type: "info",
// offset: 100,
// duration: 2500,
// });
// return;
// }
// this.dbClickSelectedFolderGroupData = foldergroup;
// this.isShowWorkt = false;
// this.isShowBread = true;
// var param = {
// folderId: foldergroup.Id,
// foldergroupId: foldergroup.FirstFolderId,
// levelId: foldergroup.LevelId,
// userId: sessionStorage.userId,
// };
// this.$axios({
// method: "get",
// url: encodeURI(
// process.env.API_HOST + "folders/foldergroup/intofoldergroup"
// ),
// params: param,
// }).then((response) => {
// if (response.data.state == 1) {
// //如果是我的文件下的文件和文件组 :0;否则是工作文件下的文件和文件组 :1
// if (this.currentPageType == 0) {
// // 加载我的文件
// this.myFilesList = response.data.data.listMyFiles;
// //zxm+ 加载我的文件夹组
// this.myListFolderGroups = response.data.data.listFolderGroups;
// //zxm+ 加载文件分组面包屑
// this.folderGroupBreads = response.data.data.listBreadFolderGroups;
// } else {
// // 加载我的文件
// this.myFilesList = response.data.data.listOtherFiles;
// //zxm+ 加载我的文件夹组
// this.myListFolderGroups = response.data.data.listOtherFolderGroups;
// //zxm+ 加载文件分组面包屑
// this.folderGroupBreads = response.data.data.listBreadFolderGroups;
// }
// clearInterval(this.timer);
// this.timer = setInterval(() => {
// this.intoFoldergroup(foldergroup);
// }, 3 * 1000);
// }
// });
// },
/**
* 点击文件分组面包屑
* obj 参数对象


+ 1
- 1
vue.config.js View File

@@ -32,7 +32,7 @@ module.exports = {
proxy: {
'/api/pms': {
// target: 'http://47.104.91.134:8089',
target:'http://10.240.32.170:8089',
target:'http://10.240.33.56:8089',

changeOrigin: true,
secure: false,


Loading…
Cancel
Save