fix:修改小组

This commit is contained in:
lixg
2022-12-04 18:26:37 +08:00
parent 80ba40049a
commit 5a166c4bfc
2 changed files with 99 additions and 70 deletions

View File

@@ -774,10 +774,11 @@
<img src="../../assets/images/courseManage/add0.png" />
<span class="btn1text">创建小组</span>
</div>
<div class="btn2" @click="showSubset">
<!-- 2022-12-2注释 后面放开 -->
<!-- <div class="btn2" @click="showSubset">
<img src="../../assets/images/courseManage/reset2.png" />
<span class="btn2text">随机分组</span>
</div>
</div> -->
</div>
<!-- 小组列表 -->
<div class="groupmain">
@@ -2455,12 +2456,13 @@ export default {
//任务大纲渲染
const getTaskList = () => {
let objtl = {
projectId: storage.get("projectId"),
projectId: state.projectId,
};
apitl
.getProjectDetail(objtl)
.then((res) => {
if (res.status == 200) {
console.log("获取阶段列表", res);
if (res.data.code == 200) {
console.log("阶段列表", res.data.data.stageList);
for (let i = 0; i < res.data.data.stageList.length; i++) {
for (
@@ -3208,6 +3210,7 @@ export default {
};
//把小组列表信息放到state里
const setGroupList = (tableData) => {
console.log("tableDatatableDatatableData", tableData);
let data = tableData;
let array = [];
data.map((value) => {
@@ -3220,7 +3223,7 @@ export default {
source: value.source == 1 ? "指定添加" : "随机分组",
completeTaskCnt: value.completeTaskCnt, //完成任务数
totalTaskCnt: value.totalTaskCnt, //累计任务数
completeRatio: value.completeRatio, //完成比例
completeRatio: value.completeRatio ? value.completeRatio : 0, //完成比例
};
array.push(obj);
});
@@ -3319,55 +3322,57 @@ export default {
projectId: state.projectId,
}).then((res) => {
console.log("get task", res.data.data);
let info = res.data.data.projectInfo;
// let start = toDate(info.beginTime / 1000, "Y-M-D h:m");
let start = info.beginTime;
// let end = toDate(info.endTime / 1000, "Y-M-D h:m");
let end = info.endTime;
state.tstartTime = info.beginTime;
state.tendTime = info.endTime;
state.tsourceBelong = info.sourceBelongName;
state.parentId = info.parentId;
state.name = info.name;
state.startTime = start;
state.endTime = end;
state.manager = info.manager;
state.remark = info.remark;
state.level = info.level;
state.tlevel = info.level;
state.systemId = info.systemId;
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.sourceBelongName;
// 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
if (res.data.code === 200) {
let info = res.data.data.projectInfo;
// let start = toDate(info.beginTime / 1000, "Y-M-D h:m");
let start = info.beginTime;
// let end = toDate(info.endTime / 1000, "Y-M-D h:m");
let end = info.endTime;
state.tstartTime = info.beginTime;
state.tendTime = info.endTime;
state.tsourceBelong = info.sourceBelongName;
state.parentId = info.parentId;
state.name = info.name;
state.startTime = start;
state.endTime = end;
state.manager = info.manager;
state.remark = info.remark;
state.level = info.level;
state.tlevel = info.level;
state.systemId = info.systemId;
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.sourceBelongName;
// 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
}
}
});
};
@@ -3385,6 +3390,7 @@ export default {
let leng = res.data.data.rows.length;
if (leng > 0) {
let arr = res.data.data.rows;
console.log("arr", arr);
setGroupList(arr);
}
})
@@ -3557,19 +3563,27 @@ export default {
}
};
const reget = () => {
console.log("state.projectId", state.projectId);
getTask({
projectId: state.projectId,
}).then((res) => {
state.action = res.data.data.projectInfo.status;
state.act =
state.action == 0
? "发布"
: state.action == 1
? "撤回"
: state.action == -1
? ""
: "-";
});
})
.then((res) => {
console.log(" res.data.data", res.data);
if (res.data.code === 200) {
state.action = res.data.data.projectInfo.status;
state.act =
state.action == 0
? "发布"
: state.action == 1
? "撤回"
: state.action == -1
? ""
: "-";
}
})
.catch((err) => {
console.log("获取任务列表失败", err);
});
};
//打开发布弹窗
const showProjectPub = () => {