feat:增加外链评估直播

This commit is contained in:
lixg
2023-01-17 19:43:45 +08:00
parent cd70db77a4
commit cd23ef10a6
21 changed files with 2844 additions and 651 deletions

View File

@@ -1,123 +1,206 @@
<template>
<div class="homeworkpage">
<!-- <TitleHead text="【投票】管理者进阶腾飞班 - 授课方式"></TitleHead> -->
<ReturnHead text="作业详情"></ReturnHead>
<div class="notice">
<div class="noticebox">
<div class="mani">
<div class="joininfo">
管理者进阶腾飞班 - 第一次作业 - 沙盘实验
</div>
<div class="joininfo">{{ data?.workName }}</div>
<div class="contenttitle">
<img class="timeimg" src="../../assets/image/ballotpage/time.png" >
<div class="timee">2022-07-20 20:00-21:00</div>
<img class="timeimg" src="../../assets/image/ballotpage/time.png" />
<div class="timee">
{{ data?.submitStartTime }}{{ data?.submitEndTime }}
</div>
</div>
<div class="timebox">
<div class="samez" style="margin-left:18px">00</div>
<div class="samez" style="margin-left: 18px">
{{ hour }}
</div>
<div class="samey"></div>
<div class="samez">00</div>
<div class="samez">
{{ minute }}
</div>
<div class="samey"></div>
<div class="samez">00</div>
<div class="samez">
{{ seconds }}
</div>
<div class="samey"></div>
</div>
</div>
</div>
</div>
<div class="notice">
<div class="noticebox">
<div class="mani">
<div class="joininfo">
作业详情
</div>
<div class="joininfo">作业详情</div>
<div class="line"></div>
<div class="contentone">
<div class="ballotdetail">
1阅读文章做名校题库翻译文言文整体文化常识和文言知识<br/>2中国古代诗词文化鉴赏大唐之音两宋清雅明清情致
{{ data?.workRequirement }}
</div>
</div>
</div>
</div>
</div>
<div class="notice">
<div class="noticebox">
<div class="mani">
<div class="joininfo">
历史纪录
</div>
<div class="joininfo">历史纪录</div>
<div class="line"></div>
<div class="contentone" style="margin-bottom:10px;">
<div class="contentone" style="margin-bottom: 10px">
<div class="hiscon">
<div
class="historyitem clearfix"
v-for="(item,index) in historywork"
:key="item.id"
:style="index%2 !==0? null : 'background-color:#F2F5F7'"
<div
class="historyitem clearfix"
v-for="(item, index) in submitList"
:key="index"
:style="index % 2 !== 0 ? null : 'background-color:#F2F5F7'"
>
<div class="itemtime">{{item.time}}</div>
<div class="itemtitle">{{item.title}}</div>
<div class="itemtime">{{ item.createTime }}</div>
<div class="itemtitle" :title="item.workUploadContent">
{{ item.workUploadContent }}
</div>
</div>
</div>
</div>
</div>
<div class="btnc">
<button class="btncc">交作业</button>
</div>
<div class="btnc" @click="dohomework">
<button class="btncc">交作业</button>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { reactive, toRefs } from "vue";
// import TitleHead from "@/components/TitleHead.vue";
export default {
name: "HomeworkPage",
components: {
// TitleHead,
},
setup() {
const state = reactive({
historywork:[
{
id:1,
time:'2022-7-20 00:00',
title:'大唐之音鉴赏 - 2022/7/20.zip'
},
{
id:2,
time:'2022-7-18 00:00',
title:'《木兰辞》翻译:叹息声一声接着一声,木兰姑娘当门在织布。…'
},
{
id:3,
time:'2022-7-14 00:00',
title:'大唐之音鉴赏 - 2022/7/20.zip'
},
{
id:4,
time:'2022-7-18 00:00',
title:'《木兰辞》翻译:叹息声一声接着一声,木兰姑娘当门在织布。…'
},
]
});
<script setup>
import { computed, onUnmounted, reactive, ref, toRefs } from "vue";
import { request, useRequest } from "@/api/request";
import {
TASK_WORK_COMMIT,
TASK_WORK_DETAIL,
TASK_WORK_SUBMIT_LIST,
WORK_HISTROY,
} from "@/api/api";
import dayjs from "dayjs";
import { useRouter } from "vue-router";
// import UploadImg from "@/components/img/UploadImg.vue";
import FileTypeImg from "@/components/FileTypeImg.vue";
import { useRoute } from "vue-router/dist/vue-router";
import { ElMessage } from "element-plus";
import ReturnHead from "@/components/ReturnHead.vue";
const fileList = ref([]);
// const fielPath = ref(import.meta.env.VITE_FILE_PATH);
const uploadRef = ref();
return {
...toRefs(state),
}
},
const centerDialogVisible = ref(false);
const sbValue = ref({
content: "",
attach: "",
});
const router = useRouter();
const returnclick = () => {
router.back();
};
const {
query: {
courseId: workId,
type,
id: taskId,
pName,
sName,
projectStatus,
projectEndTime,
infoId,
},
} = useRoute();
console.log("type", type);
const { data } =
taskId && taskId !== "undefined"
? useRequest(TASK_WORK_DETAIL, { workId, taskId })
: useRequest(TASK_WORK_DETAIL, { workId });
console.log("data==----->", data);
//作业倒计时
let hour = ref(0);
let minute = ref(0);
let seconds = ref(0);
let timer = setInterval(() => {
let endTime = parseInt(new Date(data.value.submitEndTime).getTime() / 1000);
let nowTime = parseInt(new Date().getTime() / 1000);
if (endTime > nowTime) {
hour.value = parseInt(
dayjs(data.value.submitEndTime).diff(dayjs(), "minute") / 60
);
minute.value = parseInt(
dayjs(data.value.submitEndTime).diff(dayjs(), "minute") % 60
);
seconds.value = parseInt(
dayjs(data.value.submitEndTime).diff(dayjs(), "seconds") -
(hour.value * 60 + minute.value) * 60
);
} else {
clearInterval(timer);
}
}, 1000);
onUnmounted(() => {
clearInterval(timer);
});
const { data: submitList } = useRequest(TASK_WORK_SUBMIT_LIST, {
workerId: workId,
});
console.log("submitList==----->", submitList);
//交作业
const dohomework = () => {
console.log("workId", workId, type, taskId);
router.push({
path: "/uploadwork",
query: { type: type, workId: workId, taskId: taskId },
});
};
// const open = () => {
// centerDialogVisible.value = true;
// };
// const showFileList = computed(() => {
// return fileList.value.length;
// });
// const handleClick = () => {
// console.log(fileList.value, uploadRef.value);
// if (!sbValue.value.content) {
// if (fileList.value.length === 0) {
// return ElMessage.warning("请输入作业内容");
// }
// }
// request(TASK_WORK_COMMIT, {
// projectOrRouterLogo: type,
// workUploadContent: sbValue.value.content,
// workUploadAddress: fileList.value.map((e) => e.url).join(",") || "",
// workId,
// type,
// taskId: taskId || infoId,
// }).then((res) => {
// console.log(res);
// submitList.value.unshift(res.data);
// open();
// sbValue.value.content = "";
// fileList.value = [];
// remove(0);
// clearFiles();
// });
// };
// function clearFiles() {
// uploadRef.value.clearFiles();
// }
// function remove(i) {
// uploadRef.value.remove(i);
// }
// function reUpload(i) {
// uploadRef.value.reUpload(i);
// }
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
@@ -136,7 +219,7 @@ export default {
display: flex;
justify-content: center;
// margin-top: -17.5px;
margin-top: 20px;
margin-top: 10px;
.noticebox {
width: 100%;
background: #fff;
@@ -144,60 +227,60 @@ export default {
position: relative;
display: flex;
justify-content: center;
.line{
width: 100%;
height: 0;
border-top: 1px solid #F1F2F3;
margin-top: 17px;
position:absolute;
left:0;
}
.line {
width: 100%;
height: 0;
border-top: 1px solid #f1f2f3;
margin-top: 17px;
position: absolute;
left: 0;
}
.mani {
width: 90%;
margin-top: 20px;
// position:relative;
.joininfo{
color:#0D233A;
.joininfo {
color: #0d233a;
font-size: 16px;
font-weight: bold;
}
.contenttitle{
width:100%;
.contenttitle {
width: 100%;
// height:10px;
margin-top: 15px;
// background-color: #bfa;
display:flex;
.timeimg{
display: flex;
.timeimg {
width: 12.8px;
height: 13px;
}
.timee{
color:#6E7B84;
.timee {
color: #6e7b84;
font-size: 14px;
line-height: 13px;
margin-left: 6px;
}
}
.timebox{
display:flex;
.timebox {
display: flex;
width: 100%;
height:49px;
background-color:#F2F5F7;
height: 49px;
background-color: #f2f5f7;
margin-top: 17.5px;
margin-bottom: 27.5px;
border-radius: 10px;
.samez{
color:#0060FF;
.samez {
color: #0060ff;
font-size: 18px;
line-height: 49px;
margin-left: 13px;
}
.samey{
color:#6E7B84;
.samey {
color: #6e7b84;
font-size: 14px;
line-height: 49px;
margin-left: 13px;
}
}
@@ -208,49 +291,52 @@ export default {
width: 100%;
margin-bottom: 20px;
// height: 200px;
.ballotdetail{
color:#6E7B84;
.ballotdetail {
color: #6e7b84;
line-height: 30px;
font-size: 13px;
}
.hiscon{
.hiscon {
width: 100%;
.historyitem{
.historyitem {
// margin-left: 21px;
width: 100%;
border-radius: 4px;
.itemtime{
color:#6E7B84;
.itemtime {
color: #6e7b84;
margin-left: 21px;
font-size: 12px;
margin-top: 11px;
}
.itemtitle{
.itemtitle {
line-height: 22px;
font-size: 13px;
color:#333330;
margin:10.5px 0 10.5px 21px;
color: #333330;
margin: 10.5px 0 10.5px 21px;
width: 90%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
.btnc{
width:100%;
display: flex;
justify-content: center;
.btncc{
margin-bottom: 19px;
height:33px;
width:88%;
border:0;
background-color: #2478FF;
border-radius: 6px;
color:#fff;
font-size: 14px;
}
.btnc {
width: 100%;
display: flex;
justify-content: center;
.btncc {
margin-bottom: 19px;
height: 33px;
width: 88%;
border: 0;
background-color: #2478ff;
border-radius: 6px;
color: #fff;
font-size: 14px;
}
}
}
}
}

View File

@@ -1,4 +1,9 @@
<template>
<ReturnHead
text="写作业"
:showpublish="true"
:publishWork="publishWork"
></ReturnHead>
<div
class="uploadworkpage"
:style="{
@@ -31,18 +36,58 @@
</template>
<script>
import { reactive, toRefs } from "vue";
import { reactive, toRefs, ref } from "vue";
import ReturnHead from "@/components/ReturnHead.vue";
import { request, useRequest } from "@/api/request";
import { TASK_WORK_COMMIT } from "@/api/api";
import { useRoute } from "vue-router/dist/vue-router";
import { ElMessage } from "element-plus";
export default {
name: "UploadWork",
components: {},
components: {
ReturnHead,
},
setup() {
const state = reactive({
text: "",
textarea: "",
screenHeight: document.body.clientHeight, // 屏幕高度
});
const {
query: { workId, type, taskId, infoId },
} = useRoute();
const textarea = ref("");
const fileList = ref([]);
//发布作业
const publishWork = () => {
console.log("点击了发布", workId, type, taskId);
if (!textarea.value) {
if (fileList.value.length === 0) {
return ElMessage.warning("请输入作业内容");
}
}
let obj = {
projectOrRouterLogo: type,
workUploadContent: textarea.value,
workUploadAddress: fileList.value.map((e) => e.url).join(",") || "",
workId,
type,
taskId: taskId || infoId,
};
console.log("obj", obj);
request(TASK_WORK_COMMIT, obj).then((res) => {
console.log("上传作业", res);
// submitList.value.unshift(res.data);
// open();
textarea.value = "";
fileList.value = [];
// remove(0);
// clearFiles();
});
};
return {
...toRefs(state),
publishWork,
textarea,
};
},
};
@@ -60,7 +105,7 @@ clearfix:after {
background-color: #fff;
// margin-top: 73.5px;
.inputcontainer {
margin-top: 20px;
margin-top: 10px;
background-color: #fff;
width: 100%;
// height: 100px;