mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/student-h5.git
synced 2025-12-22 17:26:48 +08:00
feat:增加外链评估直播
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user