This commit is contained in:
yuping
2023-08-04 17:51:27 +08:00
parent 379f9448bd
commit 6804653285
23 changed files with 91 additions and 17 deletions

View File

@@ -5,6 +5,7 @@
:show-upload-list="showUploadList"
:multiple="multiple"
:before-upload="beforeUpload"
:headers="headers"
@change="handleChange"
ref="imageRef"
>
@@ -17,6 +18,7 @@
import {defineProps, defineEmits, defineExpose, ref, watch} from "vue";
import {message} from "ant-design-vue";
import {FILE_UPLOAD_URL} from "@/api/config";
import {getCookieForName} from "@/api/method";
const props = defineProps({
value: {
@@ -41,7 +43,7 @@ const emit = defineEmits({})
const files = ref([])
const imageRef = ref()
const headers = { token: getCookieForName("token") };
watch(props, () => {
props.value.length !== files.value.length && (files.value = props.value)
})

View File

@@ -31,6 +31,7 @@
:data="data"
:multiple="true"
:name="name"
:headers="headers"
:accept="accept"
:action="uploadUrl"
@change="handleChange"
@@ -99,6 +100,7 @@ import {getImportStatus} from "@/api/index1";
import {useTimeout} from "@/utils/useCommon";
import err from "@/assets/images/err.png";
import success from "@/assets/images/success.png";
import {getCookieForName} from "@/api/method";
const props = defineProps({
url: String,
@@ -115,6 +117,7 @@ const props = defineProps({
const emit = defineEmits({});
const visible = ref(false);
const fileList = ref([]);
const headers = { token: getCookieForName("token") };
const uploadUrl = ref(process.env.VUE_APP_BASE_API + props.url);
const { start } = useTimeout(async ({ uuid, file }) => {
const { data: { data: upData } } = await getImportStatus(uuid);

View File

@@ -35,6 +35,7 @@
v-model:fileList="fileList"
:action="importStudent"
name="uploadFile"
:headers="headers"
:multiple="false"
@change="handleChange"
:data="{
@@ -187,6 +188,7 @@ import { message } from "ant-design-vue";
import * as api from "../../api/index1";
import { BATCH_IMPORT_SCORE } from "@/api/config";
import { useStore } from "vuex";
import {getCookieForName} from "@/api/method";
export default {
name: "ImpStu",
props: {
@@ -222,7 +224,7 @@ export default {
showBottomBar: false, // 显示底部成功条数和失败条数
fileName: "",
});
const headers = { token: getCookieForName("token") };
const userInfo = computed(() => store.state.userInfo);
const closeDrawer = () => {
@@ -341,6 +343,7 @@ export default {
userInfo,
closeDrawer,
// change,
headers,
handleChange,
BATCH_IMPORT_SCORE,
downloadEeeorData,

View File

@@ -86,6 +86,7 @@
</div>
<div class="item_inp" style="background-color: #fff;">
<a-upload name="avatar" list-type="picture-card" class="avatar-uploader" :show-upload-list="false"
:headers="headers"
:before-upload="beforeUpload">
<img class="i_upload_img" v-if="imageUrl" :src="imageUrl" alt="avatar" />
<div class="i_upload" v-else>
@@ -227,6 +228,7 @@ import AddInvistRoot from "@/components/drawers/AddInvistRoot.vue";
import { Form, message } from "ant-design-vue";
import { fileUp } from "../../api/indexEval";
import {useResetRef} from "@/utils/useCommon";
import {getCookieForName} from "@/api/method";
const removePG = () => {
formData.value.assessmentId = "";
@@ -243,6 +245,7 @@ const props = defineProps({
taskList: [],
});
const visible = ref(false);
const headers = { token: getCookieForName("token") };
const formData = useResetRef({
liveName: "",
liveLink: "",

View File

@@ -33,6 +33,7 @@
:action="importScore"
name="uploadFile"
:multiple="true"
:headers="headers"
@change="handleChange"
:showUploadList="false"
:data="{
@@ -195,6 +196,7 @@ import { reactive, toRefs } from "vue";
import { message } from "ant-design-vue";
import * as api from "../../api/index1";
import { BATCH_IMPORT_SCORE } from "@/api/config";
import {getCookieForName} from "@/api/method";
export default {
name: "EScore",
@@ -255,6 +257,7 @@ export default {
process.env.VUE_APP_FILE_PATH,
template: process.env.VUE_APP_UP_LOAD_STUDENT_SCORE_TEMPLATE,
});
const headers = { token: getCookieForName("token") };
const closeDrawer = () => {
ctx.emit("closeDraw", true);
ctx.emit("update:eScorevisibleExternalExternal", false);
@@ -405,6 +408,7 @@ export default {
BATCH_IMPORT_SCORE,
beforeUpload,
handleUpload,
headers,
removeUpload,
downloadEeeorData,
};

View File

@@ -21,6 +21,7 @@
<div class="right">
<div style="height: 176px; margin-bottom: 20px">
<a-upload-dragger v-model:fileList="fileList" :action="importHomeWork" name="uploadFile" :multiple="true"
:headers="headers"
@change="handleChange" :showUploadList="false" :data="{
type: type,
taskId: Number(id),
@@ -155,6 +156,7 @@ import { reactive, toRefs } from "vue";
import { message } from "ant-design-vue";
import * as api from "../../api/index1";
import { BATCH_IMPORT_SCORE } from "@/api/config";
import {getCookieForName} from "@/api/method";
export default {
name: "EScore",
props: {
@@ -201,6 +203,8 @@ export default {
downloadErrUrl: null, //下载失败数据
fileName: "",
});
const headers = { token: getCookieForName("token") };
const closeDrawer = () => {
ctx.emit("update:eScorevisible", false);
state.fileList = [];
@@ -344,6 +348,7 @@ export default {
closeDrawer,
handleChange,
downTemplate,
headers,
BATCH_IMPORT_SCORE,
beforeUpload,
handleUpload,

View File

@@ -30,6 +30,7 @@
:action="importLeader"
name="uploadFile"
:multiple="true"
:headers="headers"
@change="handleChange"
:showUploadList="false"
>
@@ -252,6 +253,7 @@ import { reactive, toRefs } from "vue";
import { message } from "ant-design-vue";
import * as api from "../../api/index1";
import { BATCH_IMPORT_SCORE } from "@/api/config";
import {getCookieForName} from "@/api/method";
export default {
name: "ImportStu",
props: {
@@ -279,6 +281,7 @@ export default {
process.env.VUE_APP_FILE_PATH,
template: process.env.VUE_APP_UP_LOAD_STUDENT_SCORE_TEMPLATE,
});
const headers = { token: getCookieForName("token") };
const closeDrawer = () => {
ctx.emit("closeDraw", true);
ctx.emit("update:TaskFaceImpStuvisible", false);
@@ -422,6 +425,7 @@ export default {
afterVisibleChange,
closeDrawer,
handleChange,
headers,
downTemplate,
BATCH_IMPORT_SCORE,
beforeUpload,

View File

@@ -31,6 +31,7 @@
:action="importLeader"
name="uploadFile"
:multiple="true"
:headers="headers"
@change="handleChange"
:showUploadList="false"
>
@@ -183,6 +184,7 @@ import { reactive, toRefs } from "vue";
import { message } from "ant-design-vue";
import * as api from "../../api/index1";
import { BATCH_IMPORT_SCORE } from "@/api/config";
import {getCookieForName} from "@/api/method";
export default {
name: "TaskImpStu",
props: {
@@ -221,6 +223,8 @@ export default {
process.env.VUE_APP_FILE_PATH,
template: process.env.VUE_APP_UP_LOAD_STUDENT_SCORE_TEMPLATE,
});
const headers = { token: getCookieForName("token") };
const closeDrawer = () => {
ctx.emit("closeDraw", true);
ctx.emit("update:TaskFaceImpStuvisible", false);
@@ -364,6 +368,7 @@ export default {
return {
...toRefs(state),
headers,
afterVisibleChange,
closeDrawer,
handleChange,

View File

@@ -59,6 +59,7 @@
style="width: 200px"
list-type="picture-card"
class="avatar-uploader"
:headers="headers"
:show-upload-list="false"
:before-upload="beforeUpload"
>
@@ -326,6 +327,7 @@ import CreateCertificate from "../../../components/drawers/project/CreateCertifi
import { message } from "ant-design-vue";
import * as api from "@/api/index1";
import { fileUp } from "../../../api/indexEval";
import {getCookieForName} from "@/api/method";
export default {
name: "AddCertificate",
components: {
@@ -380,6 +382,8 @@ export default {
fileType: ["jpg", "jpeg", "png", "gif", "svg", "bmp"],
});
const headers = { token: getCookieForName("token") };
const reset = () => {
state.certificateName = null;
state.certificateRemark = null;
@@ -673,6 +677,7 @@ export default {
};
return {
...toRefs(state),
headers,
afterVisibleChange,
closeDrawer,
selectCondition,

View File

@@ -68,6 +68,7 @@
style="width: 200px"
list-type="picture-card"
class="avatar-uploader"
:headers="headers"
:show-upload-list="false"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
:before-upload="beforeUpload"
@@ -118,6 +119,7 @@ import * as apiTask from "../../../api/indexTaskadd";
import { message } from "ant-design-vue";
import { RouterEditTask } from "@/api/indexTask";
import { addTempTask } from "../../../api/indexTaskadd";
import {getCookieForName} from "@/api/method";
export default {
name: "AddRef",
props: {
@@ -178,6 +180,7 @@ export default {
title: null,
isClick: false,
});
const headers = { token: getCookieForName("token") };
const closeDrawer = () => {
ctx.emit("update:CCertificate", false);
ctx.emit("update:edit", false);
@@ -335,6 +338,7 @@ export default {
};
return {
...toRefs(state),
headers,
afterVisibleChange,
closeDrawer,
handleFinish,

View File

@@ -31,6 +31,7 @@
:data="data"
:multiple="true"
:accept="accept"
:headers="headers"
:action="uploadUrl"
@change="handleChange"
v-model:file-list="fileList"
@@ -95,6 +96,7 @@ import {getImportStatus} from "@/api/index1";
import {useTimeout} from "@/utils/useCommon";
import err from "@/assets/images/err.png";
import success from "@/assets/images/success.png";
import {getCookieForName} from "@/api/method";
const props = defineProps({
url: String,
@@ -109,6 +111,7 @@ const emit = defineEmits({})
const visible = ref(false)
const fileList = ref([])
const uploadUrl = ref(process.env.VUE_APP_BASE_API + props.url);
const headers = { token: getCookieForName("token") };
const {start} = useTimeout(async ({uuid,file}) => {
const {data: {data: upData}} = await getImportStatus(uuid)
file.uploadState = upData;

View File

@@ -22,6 +22,7 @@
<a-upload
v-show="!item.imgVal"
class="in uploadBtn"
:headers="headers"
:show-upload-list="false"
:before-upload="beforeUpload"
>
@@ -50,6 +51,7 @@
import { reactive, toRefs, ref } from "vue";
import { message } from "ant-design-vue";
import { fileUp } from "../../api/indexEval";
import {getCookieForName} from "@/api/method";
export default {
name: "VoteQuestionItem",
@@ -66,6 +68,7 @@ export default {
const state = reactive({
hasImgName: "",
});
const headers = { token: getCookieForName("token") };
const handleInput = (value) => {
console.log(value.target.value);
@@ -121,6 +124,7 @@ export default {
handleDel,
handleCancel,
beforeUpload,
headers,
};
},
};

View File

@@ -13,7 +13,7 @@
<div class="delete" @click="handleDel">删除</div>
</div>
<div class="name uploadContent">
<a-upload v-show="!formData.optionPictureAddress" class="in uploadBtn" :show-upload-list="false" :before-upload="beforeUpload">
<a-upload v-show="!formData.optionPictureAddress" class="in uploadBtn" :headers="headers" :show-upload-list="false" :before-upload="beforeUpload">
<div class="addimg">+添加图片</div>
</a-upload>
<div v-show="formData.optionPictureAddress" class="picture" style="position: relative">
@@ -35,13 +35,14 @@
import { defineEmits, defineProps, ref } from "vue";
import { message } from "ant-design-vue";
import { fileUp } from "../../api/indexEval";
import {getCookieForName} from "@/api/method";
const props = defineProps({
item: {},
index: Number
})
const emit = defineEmits(['del'])
const headers = { token: getCookieForName("token") };
const formData = ref(props.item)
const beforeUpload = (file) => {