feat:锁定选中阶段 面授获取 公告 历史公告 项目积分规则 项目共享文档

This commit is contained in:
宋文超
2022-11-21 15:12:23 +08:00
parent 0680168b75
commit 8dd1053fb4
9 changed files with 790 additions and 475 deletions

View File

@@ -1049,8 +1049,8 @@
</span>
</div>
<div
v-for="item in docList"
:key="item.src"
v-for="item in fileList"
:key="item.uid"
class="docListStyle"
>
<img
@@ -1066,7 +1066,7 @@
<span style="font: oblique bold 16px Sans-serif">{{
item.name
}}</span>
<span style="color: #4ea6ff; float: right">删除</span>
<span style="color: #4ea6ff; float: right;cursor: pointer;" @click="deFile(item.uid)">删除</span>
</div>
</div>
</div>
@@ -1713,6 +1713,7 @@ import {
import { message } from "ant-design-vue";
import * as apitl from "../../api/index";
import { getTask } from "../../api/indexTaskadd";
import { editProj } from "../../api/indexTaskadd";
import { toDate } from "../../api/method";
import projSet from "../../components/Modals/projSet";
import { overview } from "../../api/indexProjStu";
@@ -1776,20 +1777,6 @@ export default {
choosedStageId: 1, // 选择的阶段id
activeSetKey: "12", //12-基础信息 13-共享文档
docChecked: true,
docList: [
{
name: "测试文档1.doc",
src: "",
},
{
name: "测试文档2.doc",
src: "",
},
{
name: "测试文档3.doc",
src: "",
},
],
//学员信息列表
tabledata: [
// {
@@ -1907,6 +1894,7 @@ export default {
ChangeGroupStuId: null, //要换组的学生id
ChangeGroupStuName: null, //要换组的学生name
ChangeGroupId: null, //要换组的学生的小组id
fileList: [], //文件列表
//进度排行表
jindutabledata: [
{
@@ -2371,16 +2359,31 @@ export default {
valueName: "", //排行榜输入姓名
//设置
name: null, //项目名称
startTime: null, //开始时间
endTime: null, //结束时间
manager: null, //项目经理
sourceBelong: null, //资源归属
remark: null, //项目说明
level: null, //项目级别
name: null, //项目名称 未改
startTime: null, //开始时间 已改
tstartTime: null, //开始事件 未改
endTime: null, //结束时间 已改
tendTime: null, //结束时间 未改
manager: null, //项目经理 未改
sourceBelong: null, //资源归属 已改
tsourceBelong: null, //资源归属 未改
remark: null, //项目说明 未改
level: null, //项目级别 已改
tlevel: null, //项目级别 未改
systemId: null, //培训分类
picUrl: null,
parentId: null,
tsystemId: null, //培训分类 未改
picUrl: null, //未改
parentId: null, //未改
courseSyncFlag: null, //未改
boeFlag: null, //未改
managerId: null, //未改
notice: null, //未改
status: null, //未改
type: null, //未改
category: null, //未改
noticeFlag: null, //未改
templateId: null, //未改
attach: null,
});
const levelList = reactive({
@@ -3309,6 +3312,9 @@ export default {
let info = res.data.data.projectInfo;
let start = toDate(info.beginTime / 1000, "Y-M-D h:m");
let end = toDate(info.endTime / 1000, "Y-M-D h:m");
state.tstartTime = info.beginTime;
state.tendTime = info.endTime;
state.tsourceBelong = info.sourceBelongId;
state.parentId = info.parentId;
state.name = info.name;
state.startTime = start;
@@ -3325,6 +3331,7 @@ export default {
: info.level == 4
? "部门级"
: "-";
state.tlevel = info.level;
state.systemId =
info.systemId == 1
? "集团级"
@@ -3335,9 +3342,20 @@ export default {
: info.systemId == 4
? "部门级"
: "-";
state.tsystemId = info.systemId;
state.checkedSty = info.courseSyncFlag == 1 ? true : false;
state.courseSyncFlag = info.courseSyncFlag;
state.checkedBOEU = info.boeFlag == 1 ? true : false;
state.boeFlag = info.boeFlag;
state.picUrl = info.picUrl;
state.managerId = info.managerId;
state.notice = info.notice;
state.status = info.status;
state.type = info.type;
state.category = info.category;
state.noticeFlag = info.noticeFlag;
// state.attach = info.attach;
// state.templateId = info.templateId;
state.sourceBelong =
info.sourceBelongId == 1
? "项目一"
@@ -3346,6 +3364,24 @@ export default {
: info.sourceBelongId == 3
? "项目三"
: "-";
// state.fileList=info.attach.split(",")
let d = info.attach.indexOf(",");
console.log(info.attach, "xgo", info.attach.length);
if (info.attach.length == 0) {
return;
} else if (info.attach.length !== 0 && d == -1) {
return;
} else {
console.log(info.attach, "xgo");
// let str = JSON.parse(info.attach)
// console.log("赚回来",str)
// let luj = info.attach.split(",")
let luj = info.attach;
console.log("lulj", luj);
console.log("赚回来", JSON.parse(luj));
state.fileList = JSON.parse(luj)
// state.fileList = luj
}
});
};
//获取小组列表
@@ -3453,8 +3489,54 @@ export default {
//end---------项目概览
const handleChange = (info) => {
let list = [];
if (info.file.status !== "uploading") {
console.log(info.file, info.fileList);
console.log(info.file.response.data, info.fileList);
// info.fileList.map((item) => {
// //把地址放到list里
// // list.push(item.response.data);
// // list.push(JSON.stringify(item))
// state.fileList.push(item)
// });
state.fileList.push(info.file)
list = state.fileList
console.log("list", list);
// let str = list.join(",");
let str = JSON.stringify(list);
console.log("str", str);
//要编辑项目
editProj({
attach: str,
beginTime: state.tstartTime.slice(0, 10),
// beginTime:1668643200,
boeFlag: state.boeFlag,
category: state.category,
courseSyncFlag: state.courseSyncFlag,
endTime: state.tendTime.slice(0, 10),
// endTime: 1668816000,
level: state.tlevel,
manager: state.manager,
managerId: state.managerId,
name: state.name,
notice: state.notice,
noticeFlag: state.noticeFlag,
parentId: state.parentId,
picUrl: state.picUrl,
projectId: state.projectId,
remark: state.remark,
sourceBelongId: Number(state.tsourceBelong),
status: state.status,
systemId: state.tsystemId,
templateId: state.templateId || 0,
type: state.type,
})
.then((res) => {
console.log("上传成功", res);
})
.catch((err) => {
console.log("上传失败了", err);
});
}
if (info.file.status === "done") {
@@ -3644,6 +3726,46 @@ export default {
console.log("模版保存失败", err);
});
};
//删除文件
const deFile=(id)=>{
console.log(id)
let index = state.fileList.findIndex(item=>{item.uid==id})
state.fileList.splice(index,1)
let str = JSON.stringify(state.fileList)
editProj({
attach: str,
beginTime: state.tstartTime.slice(0, 10),
// beginTime:1668643200,
boeFlag: state.boeFlag,
category: state.category,
courseSyncFlag: state.courseSyncFlag,
endTime: state.tendTime.slice(0, 10),
// endTime: 1668816000,
level: state.tlevel,
manager: state.manager,
managerId: state.managerId,
name: state.name,
notice: state.notice,
noticeFlag: state.noticeFlag,
parentId: state.parentId,
picUrl: state.picUrl,
projectId: state.projectId,
remark: state.remark,
sourceBelongId: Number(state.tsourceBelong),
status: state.status,
systemId: state.tsystemId,
templateId: state.templateId || 0,
type: state.type,
})
.then((res) => {
console.log("上传成功", res);
message.destroy()
return message.success("删除成功")
})
.catch((err) => {
console.log("上传失败了", err);
});
}
onMounted(() => {
getStu();
getTaskList();
@@ -3651,6 +3773,8 @@ export default {
getGroup();
getOverview();
reget();
// let a = state.attach.split(",")
// state.fileList = a
});
return {
...toRefs(state),
@@ -3744,6 +3868,7 @@ export default {
closeStartModal,
templateProject,
changeGrouped,
deFile,
};
},
};