|
@@ -361,6 +361,12 @@
|
|
|
}"
|
|
|
@modified="getList"
|
|
|
></gpt-question-dialog>
|
|
|
+ <!-- TaskProgressDialog -->
|
|
|
+ <task-progress-dialog
|
|
|
+ ref="TaskProgressDialog"
|
|
|
+ :task="curTask"
|
|
|
+ :download-handle="taskFinished"
|
|
|
+ ></task-progress-dialog>
|
|
|
<router-view></router-view>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -377,6 +383,7 @@ import {
|
|
|
classifyQuestionPageListApi,
|
|
|
getAiNums,
|
|
|
checkOptionRepeatApi,
|
|
|
+ asyncTaskDownloadApi,
|
|
|
} from "../api";
|
|
|
import QuestionStatisticsDialog from "../components/QuestionStatisticsDialog.vue";
|
|
|
import QuestionSafetySetDialog from "../components/QuestionSafetySetDialog.vue";
|
|
@@ -388,6 +395,7 @@ import FolderQuestionManageDialog from "../components/FolderQuestionManageDialog
|
|
|
import PropertyTreeSelect from "../components/PropertyTreeSelect.vue";
|
|
|
import QuestionImportEdit from "../components/QuestionImportEdit.vue";
|
|
|
import GptQuestionDialog from "../components/GptQuestionDialog.vue";
|
|
|
+import TaskProgressDialog from "@/components/TaskProgressDialog.vue";
|
|
|
import { mapActions, mapGetters, mapMutations } from "vuex";
|
|
|
import { USER_SIGNIN } from "../../portal/store/user";
|
|
|
import QuestionFolder from "@/modules/question/components/QuestionFolder.vue";
|
|
@@ -407,6 +415,7 @@ export default {
|
|
|
QuestionImportEdit,
|
|
|
GptQuestionDialog,
|
|
|
QuestionFolder,
|
|
|
+ TaskProgressDialog,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -444,6 +453,8 @@ export default {
|
|
|
curActionQids: [],
|
|
|
aiWarningMsg: "",
|
|
|
downloading: false,
|
|
|
+ // async task
|
|
|
+ curTask: {},
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -594,8 +605,22 @@ export default {
|
|
|
if (this.downloading) return;
|
|
|
this.downloading = true;
|
|
|
|
|
|
+ const res = await exportQuestionApi(this.filter).catch(() => {});
|
|
|
+ this.downloading = false;
|
|
|
+
|
|
|
+ if (!res) return;
|
|
|
+ this.curTask = {
|
|
|
+ id: res.data.taskId,
|
|
|
+ name: "试题导出",
|
|
|
+ };
|
|
|
+ this.$refs.TaskProgressDialog.open();
|
|
|
+ },
|
|
|
+ async taskFinished() {
|
|
|
+ if (this.downloading) return;
|
|
|
+ this.downloading = true;
|
|
|
+
|
|
|
const res = await downloadByApi(() => {
|
|
|
- return exportQuestionApi(this.filter);
|
|
|
+ return asyncTaskDownloadApi(this.curTask.id);
|
|
|
}).catch((e) => {
|
|
|
this.$message.error(e || "导出失败,请重新尝试!");
|
|
|
});
|