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

bug fixes

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