Commit 72a65e84 by 前端

Merge branch 'master' into 'v3.26.3'

Master

See merge request !61
2 parents 99b3d115 7f3f73b7
......@@ -48,5 +48,13 @@ export const detailShelfStatusEnum = {
2: {
label: '上架失败',
color: '#FDB757'
},
3: {
label: '上架中',
color: '#2CCA74'
},
4: {
label: '已下架',
color: '#C6C6C6'
}
}
......@@ -36,6 +36,7 @@
上传文件
<input type="file" style="opacity: 0;width: 0;height: 0;" ref="file" accept=".xlsx" @change="uploadFile" />
</el-button>
<img v-if="fileLoading" class="loading-img" :src="require('@/assets/loading.png')" alt="" />
<div class="file-wrap" v-if="uploadFormObj.fileName">
<div class="file-box" @click="toOpenPDF(uploadFormObj.fileUrl)">
<div class="info" v-if="uploadFormObj.fileName">
......@@ -72,6 +73,7 @@ export default {
taskStatusEnum,
shelfStatusEnum,
isVisible: false,
fileLoading: false,
uploadRules: {
taskMonth: [{ required: true, message: '请选择任务时间', trigger: 'change' }],
taskCount: [{ required: true, message: '请输入任务数', trigger: 'change' }],
......@@ -345,12 +347,14 @@ export default {
},
// 上传excel
uploadFile(e) {
this.fileLoading = true
const file = e.srcElement.files[0]
let AllImgExt = '.xlsx' //文件格式判断
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt !== extName) {
this.$message.error('文件格式不正确')
this.$refs.file.value = ''
this.fileLoading = false
return false
}
this.uploadFormObj.fileName = file.name
......@@ -377,6 +381,7 @@ export default {
})
.finally(end => {
this.$refs.file.value = ''
this.fileLoading = false
})
}
},
......@@ -434,6 +439,7 @@ export default {
},
handleClose() {
this.isVisible = false
this.fileLoading = false
this.uploadFormObj = {
id: '',
fileUrl: '',
......@@ -459,6 +465,21 @@ export default {
/deep/ .task-input {
width: 284px;
}
.loading-img {
width: 24px;
height: 24px;
vertical-align: middle;
margin-left: 12px;
animation: rotate 2s linear infinite;
}
@keyframes rotate {
from {
transform: rotate(0deg); /* 动画开始时的旋转角度 */
}
to {
transform: rotate(360deg); /* 动画结束时的旋转角度 */
}
}
.file-wrap {
margin: 8px 0 0 154px;
display: flex;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!