This commit is contained in:
kclf
2022-12-06 11:53:08 +08:00
parent f3b8b3c3df
commit 6edbaec1bc
3 changed files with 25 additions and 29 deletions

13
package-lock.json generated
View File

@@ -13,6 +13,7 @@
"ant-design-vue": "^3.2.12",
"axios": "^1.1.3",
"core-js": "^3.8.3",
"dayjs": "^1.11.6",
"element-plus": "^2.2.17",
"element-resize-detector": "^1.2.4",
"html2canvas": "^1.4.1",
@@ -4949,9 +4950,9 @@
}
},
"node_modules/dayjs": {
"version": "1.11.5",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.5.tgz",
"integrity": "sha512-CAdX5Q3YW3Gclyo5Vpqkgpj8fSdLQcRuzfX6mC6Phy0nfJ0eGYOeS7m4mt2plDWLAtA4TqTakvbboHvUxfe4iA=="
"version": "1.11.6",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.6.tgz",
"integrity": "sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ=="
},
"node_modules/debug": {
"version": "4.3.4",
@@ -15686,9 +15687,9 @@
}
},
"dayjs": {
"version": "1.11.5",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.5.tgz",
"integrity": "sha512-CAdX5Q3YW3Gclyo5Vpqkgpj8fSdLQcRuzfX6mC6Phy0nfJ0eGYOeS7m4mt2plDWLAtA4TqTakvbboHvUxfe4iA=="
"version": "1.11.6",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.6.tgz",
"integrity": "sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ=="
},
"debug": {
"version": "4.3.4",

BIN
src/assets/del.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -129,13 +129,22 @@
action="/manageApi/vote/baseVoteupload"
v-model:file-list="fileList"
> -->
<a-upload
:before-upload="beforeUpload"
:multiple="false"
:max-count="1"
v-model:file-list="fileList"
>
<a-upload :before-upload="beforeUpload" :max-count="1">
<button class="xkbtn">点击上传</button>
<template #itemRender="{ file, actions }">
<a-space v-if="file.type.indexOf('sheet') > -1">
<span :style="file.status === 'error' ? 'color: red' : ''">
{{ file.name }}
</span>
<a href="javascript:;" @click="actions.remove">
<img
src="../../assets/del.png"
alt="del"
style="width: 12px; height: 12px"
/>
</a>
</a-space>
</template>
</a-upload>
<div v-if="voteCount > 0">
<a-tag color="processing">
@@ -286,36 +295,22 @@ export default {
// 限制文件格式上传
const beforeUpload = (file) => {
console.log(file);
if (file.type.indexOf("sheet") == -1) {
message.destroy();
message.error("请上传正确的文件格式");
console.log(state.fileList);
state.fileList = [];
return;
return false;
}
// let resFileList = [...info.fileList];
// resFileList.map((file) => {
// if (file.response) {
// // Component will show file.url as link
// file.url = file.response.url;
// console.log("file========", file);
// console.log("file========", file.response);
// state.voteCount = file.response.data;
// }
// });
const formData = new FormData();
formData.append("uploadFile", file);
baseVoteupload(formData).then((res) => {
if (res.data.code === 200) {
console.log(res);
state.basevote = res.data.data;
}
});
return false;
};
//删除题干信息接口