提交 f6f6c2a6 authored 作者: pengxiaohui's avatar pengxiaohui

bug fixes

上级 b4837ba9
......@@ -71,6 +71,7 @@
import TableList from '@/components/TableList'
import { getCourseList, createCourse, updateCourse, deleteCourse, importCourse, exportCourseList } from '@/api/course'
import { splitStrLast, funDownload } from '@/utils/utils'
import _ from 'lodash'
const defaultForm = {
chinese_name: '',
english_name: '',
......@@ -171,7 +172,6 @@ export default {
this.fileList = []
},
beforeUpload(file) {
console.log(file)
const suffix = splitStrLast(file.name, '.')
if (!['xlsx', 'xls'].includes(suffix)) {
this.$message.error('只能上传excel文件')
......@@ -196,9 +196,9 @@ export default {
})
}
},
submitUpload() {
submitUpload: _.debounce(function() {
this.$refs.upload.submit()
},
}, 500),
handleCommand(type) {
if (type === 'all') this.fetchExportAll()
},
......
......@@ -86,7 +86,7 @@
</div>
<div style="text-align:center;">
<el-button size="mini" @click="dialogVisible = false">取消</el-button>
<el-button type="primary" size="mini" @click="submitUpload" :disabled="fileLoading"><i class="el-icon-loading" v-if="fileLoading"></i>确认提交</el-button>
<el-button type="primary" size="mini" @click="submitUpload">确认提交</el-button>
</div>
</el-dialog>
</div>
......@@ -119,8 +119,7 @@ export default {
{ label: '学位信息', value: 'degree' },
{ label: '课程信息', value: 'course' }
],
importType: 'info',
fileLoading: false
importType: 'info'
}
},
computed: {
......@@ -250,7 +249,6 @@ export default {
this.$message.error('只能上传excel文件')
return false
} else {
this.fileLoading = true
const formData = new window.FormData()
formData.append('type', this.importType)
formData.append('file', file)
......@@ -260,7 +258,6 @@ export default {
this.$message.success('导入数据成功')
resolve(true)
this.$refs.tabList.refetch()
this.fileLoading = false
window.setTimeout(() => {
this.dialogVisible = false
}, 300)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论