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

@@ -460,11 +460,15 @@
</div> </div>
<div class="time"> <div class="time">
<div class="timetext">开始时间</div> <div class="timetext">开始时间</div>
<div class="timetext">{{ item.startTime!==null?item.startTime:''}}</div> <div class="timetext">
{{ item.startTime !== null ? item.startTime : "" }}
</div>
</div> </div>
<div class="progress"> <div class="progress">
<div class="progresstext"> <div class="progresstext">
{{ item.complete?item.complete:0 }}/{{ item.total?item.total:0 }} {{ item.complete ? item.complete : 0 }}/{{
item.total ? item.total : 0
}}
</div> </div>
<div style="display: flex"> <div style="display: flex">
<a-progress <a-progress
@@ -474,7 +478,7 @@
trailColor="rgba(253, 209, 98, 0.2)" trailColor="rgba(253, 209, 98, 0.2)"
/> />
<span class="progresstext" style="margin-left: 10px" <span class="progresstext" style="margin-left: 10px"
>{{ item.percent?item.percent:0 }}%</span >{{ item.percent ? item.percent : 0 }}%</span
> >
</div> </div>
</div> </div>
@@ -1217,6 +1221,15 @@
</div> </div>
</div> </div>
</a-modal> </a-modal>
<!-- 二维码弹窗 -->
<two-dimensional-code
v-model:codevisible="codevisible"
:codeInfo="codeInfo"
index="0"
type="课程二维码"
/>
<!-- 二维码弹窗 -->
</div> </div>
</template> </template>
<script> <script>
@@ -1243,6 +1256,7 @@ import { GetRouterDetail } from "@/api/indexTask";
import * as api from "../../api/index1"; import * as api from "../../api/index1";
import { toDate } from "../../api/method"; import { toDate } from "../../api/method";
import { editRoutered } from "../../api/indexLearningPath"; import { editRoutered } from "../../api/indexLearningPath";
import TwoDimensionalCode from "../../components/TwoDimensionalCode.vue";
export default { export default {
name: "LevelAdd", name: "LevelAdd",
components: { components: {
@@ -1257,6 +1271,7 @@ export default {
FaceManage, FaceManage,
WorkManage, WorkManage,
SeeStu, SeeStu,
TwoDimensionalCode,
}, },
setup() { setup() {
// const routers = useRoute(); // const routers = useRoute();
@@ -1888,7 +1903,7 @@ export default {
const getOverview = () => { const getOverview = () => {
getRouterOverview(state.routerId) getRouterOverview(state.routerId)
.then((res) => { .then((res) => {
console.log(res) console.log(res);
Object.keys(res.data.data.routerInfoOverview).forEach((item) => { Object.keys(res.data.data.routerInfoOverview).forEach((item) => {
levelList.routerInfoOverview[item] = levelList.routerInfoOverview[item] =
res.data.data.routerInfoOverview[item] || 0; res.data.data.routerInfoOverview[item] || 0;
@@ -1913,7 +1928,7 @@ export default {
const myGetRouterDetail = () => { const myGetRouterDetail = () => {
GetRouterDetail(state.routerId) GetRouterDetail(state.routerId)
.then((res) => { .then((res) => {
console.log('router-list',res) console.log("router-list", res);
if (res.data.data.routerInfo.status == 1) { if (res.data.data.routerInfo.status == 1) {
state.nodata = false; state.nodata = false;
} }

View File

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