--fix 导入bug

This commit is contained in:
yuping
2023-01-15 18:58:04 +08:00
parent ac7d6f7627
commit 033615ea93
2 changed files with 13 additions and 16 deletions

View File

@@ -36,28 +36,28 @@
? { ? {
targetId: Number(courseId), targetId: Number(courseId),
type: 3, type: 3,
userId: userId, userId: userInfo.id,
userName: userName, userName: userInfo.realName,
} }
: courseType == 3 : courseType == 3
? { ? {
targetId: Number(courseId), targetId: Number(courseId),
type: 1, type: 1,
userId: userId, userId: userInfo.id,
userName: userName, userName: userInfo.realName,
} }
: courseType == 4 : courseType == 4
? { ? {
targetId: Number(courseId), targetId: Number(courseId),
type: 2, type: 2,
userId: userId, userId: userInfo.id,
userName: userName, userName: userInfo.realName,
} }
: { : {
targetId: Number(courseId), targetId: Number(courseId),
type: 3, type: 3,
userId: userId, userId: userInfo.id,
userName: userName, userName: userInfo.realName,
} }
" "
:showUploadList="false" :showUploadList="false"
@@ -197,7 +197,7 @@
</template> </template>
<script> <script>
import { reactive, toRefs } from "vue"; import {computed, reactive, toRefs} from "vue";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import * as api from "../../api/index1"; import * as api from "../../api/index1";
import { BATCH_IMPORT_SCORE } from "@/api/config"; import { BATCH_IMPORT_SCORE } from "@/api/config";
@@ -238,11 +238,11 @@ export default {
errNum: 0, //失败数据数 errNum: 0, //失败数据数
downloadErrUrl: "", downloadErrUrl: "",
showBottomBar: false, // 显示底部成功条数和失败条数 showBottomBar: false, // 显示底部成功条数和失败条数
userId: store.state.userInfo.id,
userName: store.state.userInfo.realName,
fileName: "", fileName: "",
}); });
const userInfo = computed(()=>store.state.userInfo)
const closeDrawer = () => { const closeDrawer = () => {
clearInterval(state.timers); clearInterval(state.timers);
state.fileList = []; state.fileList = [];
@@ -356,6 +356,7 @@ export default {
return { return {
...toRefs(state), ...toRefs(state),
afterVisibleChange, afterVisibleChange,
userInfo,
closeDrawer, closeDrawer,
// change, // change,
handleChange, handleChange,

View File

@@ -188,11 +188,10 @@
</a-drawer> </a-drawer>
</template> </template>
<script> <script>
import { reactive, toRefs } from "vue"; import {reactive, toRefs} from "vue";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import * as api from "../../api/index1"; import * as api from "../../api/index1";
import { BATCH_IMPORT_SCORE } from "@/api/config"; import { BATCH_IMPORT_SCORE } from "@/api/config";
import { useStore } from "vuex";
export default { export default {
name: "EScore", name: "EScore",
props: { props: {
@@ -219,7 +218,6 @@ export default {
}, },
}, },
setup(props, ctx) { setup(props, ctx) {
const store = useStore();
const state = reactive({ const state = reactive({
fileType: ["xls", "xlsx"], fileType: ["xls", "xlsx"],
importHomeWork: importHomeWork:
@@ -231,8 +229,6 @@ export default {
succNum: 0, //成功数据数 succNum: 0, //成功数据数
errNum: 0, //失败数据数 errNum: 0, //失败数据数
downloadErrUrl: null, //下载失败数据 downloadErrUrl: null, //下载失败数据
userId: store.state.userInfo.id,
userName: store.state.userInfo.realName,
fileName: "", fileName: "",
}); });
const closeDrawer = () => { const closeDrawer = () => {