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,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;