|
@@ -21,18 +21,27 @@
|
|
|
>
|
|
|
</template>
|
|
|
</qm-low-form>
|
|
|
+ <my-modal v-model:open="showProgressDialog" title="考生导入进度">
|
|
|
+ <p>{{ curFileName }}</p>
|
|
|
+ <a-progress :percent="progress" :status="progressStatus" />
|
|
|
+ </my-modal>
|
|
|
</my-modal>
|
|
|
</template>
|
|
|
<script name="StuImportFileDialog" lang="ts" setup>
|
|
|
import { ref, reactive, h } from "vue";
|
|
|
-import { importStu, exportStu } from "@/ap/baseDataConfig";
|
|
|
+import { importStu, exportStu, importStuProgress } from "@/ap/baseDataConfig";
|
|
|
import { VerticalAlignBottomOutlined } from "@ant-design/icons-vue";
|
|
|
-import { downloadByCrossUrl } from "@/utils/tool";
|
|
|
import { useUserStore } from "@/store";
|
|
|
|
|
|
const userStore = useUserStore();
|
|
|
const form = ref();
|
|
|
const visible = defineModel();
|
|
|
+const showProgressDialog = ref(false);
|
|
|
+const progressStatus = ref<
|
|
|
+ "active" | "success" | "normal" | "exception" | undefined
|
|
|
+>("active"); // 'exception' 'normal' 'success'
|
|
|
+const progress = ref(0);
|
|
|
+const curFileName = ref("");
|
|
|
const emit = defineEmits(["success"]);
|
|
|
|
|
|
const params = reactive({
|
|
@@ -48,19 +57,21 @@ const rules = {
|
|
|
};
|
|
|
const getFile = (file: any) => {
|
|
|
params.file = file;
|
|
|
+ curFileName.value = file?.name || "";
|
|
|
};
|
|
|
const submitHandle = () => {
|
|
|
form.value.formRef.validate().then(() => {
|
|
|
importStu({ examId: userStore.curExam?.id as number, ...params }).then(
|
|
|
(res: any) => {
|
|
|
- window.$message.success("考生导入成功");
|
|
|
- visible.value = false;
|
|
|
+ let taskId = res.taskId;
|
|
|
+ showProgressDialog.value = true;
|
|
|
+ // visible.value = false;
|
|
|
}
|
|
|
);
|
|
|
});
|
|
|
};
|
|
|
const downloadTpl = () => {
|
|
|
- exportStu({ examId: userStore.curExam.id });
|
|
|
+ exportStu({ examId: userStore.curExam?.id });
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="less" scoped></style>
|