mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-14 21:36:44 +08:00
style:增加下载中心
This commit is contained in:
@@ -24,11 +24,26 @@
|
||||
<div class="upload">
|
||||
<div class="text">上传:</div>
|
||||
<div class="right">
|
||||
<div class="load">
|
||||
<div style="height: 176px; margin-bottom: 20px">
|
||||
<a-upload-dragger
|
||||
v-model:fileList="fileList"
|
||||
:action="BATCH_IMPORT_SCORE + '?offcoursePlanId=' + id"
|
||||
name="file"
|
||||
:multiple="true"
|
||||
@change="handleChange"
|
||||
>
|
||||
<p class="ant-upload-drag-icon">
|
||||
<inbox-outlined></inbox-outlined>
|
||||
</p>
|
||||
<p class="ant-upload-text">点击或将文件拖拽到此处上传</p>
|
||||
<p class="ant-upload-hint">支持扩展名:.xls/.xlsx</p>
|
||||
</a-upload-dragger>
|
||||
</div>
|
||||
<!-- <div class="load">
|
||||
<div class="cloud"></div>
|
||||
<div class="tip">点击或将文件拖拽到此处上传</div>
|
||||
<div class="tipz">支持扩展名:.xls/.xlsx</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="loadstate">
|
||||
<div class="loadborder">
|
||||
<div class="content">
|
||||
@@ -111,6 +126,9 @@
|
||||
|
||||
<script>
|
||||
import { reactive, toRefs } from "vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import * as api from "../../api/index1";
|
||||
import { BATCH_IMPORT_SCORE } from "@/api/config";
|
||||
export default {
|
||||
name: "ImpStu",
|
||||
props: {
|
||||
@@ -128,12 +146,36 @@ export default {
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log("state", bool);
|
||||
};
|
||||
|
||||
//上传文件
|
||||
const handleChange = (info) => {
|
||||
console.log("info", info, props.id);
|
||||
const status = info.file.status;
|
||||
if (status !== "uploading") {
|
||||
console.log(info.file, info.fileList);
|
||||
}
|
||||
if (status === "done") {
|
||||
const formData = new FormData();
|
||||
formData.append("uploadFile", info.file);
|
||||
// formData.append("offcoursePlanId", props.id);
|
||||
console.log(info.file);
|
||||
api.batchImportScore(props.id, formData).then((res) => {
|
||||
// if (res.data.code === 200) {
|
||||
// console.log('上传成功')
|
||||
// }
|
||||
console.log("上传成绩", res);
|
||||
});
|
||||
message.success(`${info.file.name} file uploaded successfully.`);
|
||||
} else if (status === "error") {
|
||||
message.error(`${info.file.name} file upload failed.`);
|
||||
}
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
afterVisibleChange,
|
||||
closeDrawer,
|
||||
// change,
|
||||
handleChange,
|
||||
BATCH_IMPORT_SCORE,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user