feat:修改面授课开课去上课样式

This commit is contained in:
wyx
2023-03-23 22:12:49 +08:00
parent c34edd8218
commit 874992b594
2 changed files with 70 additions and 4 deletions

View File

@@ -142,17 +142,38 @@
:style="{ background: el.statusName !== '已结束' && (el.statusName || data.unlockMode === 1) ? '#2478ff' : '#999' }" @click="toFinish(el)"> :style="{ background: el.statusName !== '已结束' && (el.statusName || data.unlockMode === 1) ? '#2478ff' : '#999' }" @click="toFinish(el)">
{{el.statusName || (data.unlockMode === 1 ? TASK_TYPES.toName[el.type] : "未解锁")}} {{el.statusName || (data.unlockMode === 1 ? TASK_TYPES.toName[el.type] : "未解锁")}}
</div> </div>
<template #dropdown v-if="el.type===2 && el.targetId?.split(',')?.length > 1"> <!-- <template #dropdown v-if="el.type===2 && el.targetId?.split(',')?.length > 1">
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item v-for="(name,key) in el.targetName?.split(',')" :key="key" @click="toOffcoursePlanPage(el.targetId?.split(',')[key])">{{ name }}</el-dropdown-item> <el-dropdown-item v-for="(name,key) in el.targetName?.split(',')" :key="key" @click="toOffcoursePlanPage(el.targetId?.split(',')[key])">{{ name }}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template> -->
</el-dropdown> </el-dropdown>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- 开课列表弹框 -->
<el-dialog title="" top="120px" v-model="openCourseVisible" :show-close="false"
style="display:flex;justify-content:center;align-items:center;min-height: 320px;padding:0;border-radius: 4px;"
width="80%">
<div style="display: flex;justify-content:space-between;align-items:center;margin-bottom: 22px;width: 100%;">
<div style="width:88px;color:#333333;font-size: 16px;font-weight: 600;">开课列表</div>
<div
@click="openCourseVisible = false"
style="font-size: 12px;cursor:pointer;">X</div>
</div>
<div style="width: 100%;min-height:210px;margin-top: 12px;">
<div
v-for="item,key in openCourseList"
style="width: 100%;display: flex;justify-content: space-between;align-items: center;margin-bottom: 12px;background: rgb(247, 251, 253);height: 40px;padding: 5px;border-radius: 5px;">
<div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;width: 200px;">{{ item }}</div>
<div
@click="toOffcoursePlanPage(openCourseIdList[key])"
style="width:60px;height:30px;text-align:center;line-height:30px;background:#0078fc;border-radius:5px;color:#fff;cursor: pointer;">去上课</div>
</div>
</div>
</el-dialog>
</div> </div>
</template> </template>
@@ -307,6 +328,9 @@ function judgeTaskIsEnd(type, endTimes, status) {
} }
return isEnd; return isEnd;
} }
const openCourseVisible = ref(false);
const openCourseList = ref([]);
const openCourseIdList = ref([]);
function toFinish(d) { function toFinish(d) {
if (data.value.unlockMode !== 1 && !d.statusName) { if (data.value.unlockMode !== 1 && !d.statusName) {
ElMessage.warning("当前未解锁"); ElMessage.warning("当前未解锁");
@@ -317,6 +341,9 @@ function toFinish(d) {
return ElMessage.error("还未添加开课,请联系管理员!") return ElMessage.error("还未添加开课,请联系管理员!")
} }
if(d.targetId.split(',').length>1){ if(d.targetId.split(',').length>1){
openCourseList.value = d.targetName?.split(',');
openCourseIdList.value = d.targetId?.split(',');
openCourseVisible.value = true;
return return
} }
} }
@@ -512,6 +539,12 @@ function whiteTypes(type) {
<style lang="scss"> <style lang="scss">
.pathmap { .pathmap {
.el-dialog__body{
width: 80%;
}
.el-dialog__header{
display: none;
}
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@@ -164,11 +164,11 @@
<div class="goclass" @click="toFinish(el, item.stageName, item.id)" :style="{ background: el.statusName !== '已结束' &&(el.statusName || data.unlockMode === 1) ? '#2478ff' : '#999' }"> <div class="goclass" @click="toFinish(el, item.stageName, item.id)" :style="{ background: el.statusName !== '已结束' &&(el.statusName || data.unlockMode === 1) ? '#2478ff' : '#999' }">
{{el.statusName || (data.unlockMode === 1 ? TASK_TYPES.toName[el.type] : "未解锁")}} {{el.statusName || (data.unlockMode === 1 ? TASK_TYPES.toName[el.type] : "未解锁")}}
</div> </div>
<template #dropdown v-if="el.type===2 && el.targetId?.split(',')?.length > 1"> <!-- <template #dropdown v-if="el.type===2 && el.targetId?.split(',')?.length > 1">
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item v-for="(name,key) in el.targetName?.split(',')" :key="key" @click="toOffcoursePlanPage(el.targetId?.split(',')[key])">{{ name }}</el-dropdown-item> <el-dropdown-item v-for="(name,key) in el.targetName?.split(',')" :key="key" @click="toOffcoursePlanPage(el.targetId?.split(',')[key])">{{ name }}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template> -->
</el-dropdown> </el-dropdown>
@@ -195,6 +195,27 @@
</div> </div>
</div> --> </div> -->
</div> </div>
<!-- 开课列表弹框 -->
<el-dialog title="" top="120px" v-model="openCourseVisible" :show-close="false"
style="display:flex;justify-content:center;align-items:center;min-height: 320px;padding:0;border-radius: 4px;"
width="80%">
<div style="display: flex;justify-content:space-between;align-items:center;margin-bottom: 22px;width: 100%;">
<div style="width:88px;color:#333333;font-size: 16px;font-weight: 600;">开课列表</div>
<div
@click="openCourseVisible = false"
style="font-size: 12px;cursor:pointer;">X</div>
</div>
<div style="width: 100%;min-height:210px;margin-top: 12px;">
<div
v-for="item,key in openCourseList"
style="width: 100%;display: flex;justify-content: space-between;align-items: center;margin-bottom: 12px;background: rgb(247, 251, 253);height: 40px;padding: 5px;border-radius: 5px;">
<div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;width: 200px;">{{ item }}</div>
<div
@click="toOffcoursePlanPage(openCourseIdList[key])"
style="width:60px;height:30px;text-align:center;line-height:30px;background:#0078fc;border-radius:5px;color:#fff;cursor: pointer;">去上课</div>
</div>
</div>
</el-dialog>
</div> </div>
</template> </template>
@@ -305,6 +326,9 @@ function getTaskStatus(d) {
return "进行中"; return "进行中";
} }
console.log("datadata", data); console.log("datadata", data);
const openCourseVisible = ref(false);
const openCourseList = ref([]);
const openCourseIdList = ref([]);
const userInfo = computed(() => store.state.userInfo); const userInfo = computed(() => store.state.userInfo);
const activeName = ref("first"); const activeName = ref("first");
@@ -431,6 +455,9 @@ function toFinish(d, sName, chapterOrStageId) {
return ElMessage.error("还未添加开课,请联系管理员!") return ElMessage.error("还未添加开课,请联系管理员!")
} }
if(d.targetId.split(',').length>1){ if(d.targetId.split(',').length>1){
openCourseList.value = d.targetName?.split(',');
openCourseIdList.value = d.targetId?.split(',');
openCourseVisible.value = true;
return return
} }
} }
@@ -624,6 +651,12 @@ const queryAllStatus = (data) => {
<style lang="scss"> <style lang="scss">
.projectdetails { .projectdetails {
.el-dialog__body{
width: 80%;
}
.el-dialog__header{
display: none;
}
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;