|
@@ -169,13 +169,13 @@
|
|
</div>
|
|
</div>
|
|
<div class="question-list">
|
|
<div class="question-list">
|
|
<div class="icon-btn-group">
|
|
<div class="icon-btn-group">
|
|
- <svg-btn
|
|
|
|
|
|
+ <!-- <svg-btn
|
|
name="xinzeng"
|
|
name="xinzeng"
|
|
@click="toCreateQuestion"
|
|
@click="toCreateQuestion"
|
|
v-if="!gptQuestionEnable"
|
|
v-if="!gptQuestionEnable"
|
|
>创建试题</svg-btn
|
|
>创建试题</svg-btn
|
|
- >
|
|
|
|
- <el-dropdown v-else>
|
|
|
|
|
|
+ > -->
|
|
|
|
+ <el-dropdown>
|
|
<svg-btn name="xinzeng">创建试题</svg-btn>
|
|
<svg-btn name="xinzeng">创建试题</svg-btn>
|
|
<el-dropdown-menu slot="dropdown" class="action-dropdown">
|
|
<el-dropdown-menu slot="dropdown" class="action-dropdown">
|
|
<el-dropdown-item>
|
|
<el-dropdown-item>
|
|
@@ -346,7 +346,6 @@
|
|
></question-import-edit>
|
|
></question-import-edit>
|
|
<!-- GptQuestionDialog -->
|
|
<!-- GptQuestionDialog -->
|
|
<gpt-question-dialog
|
|
<gpt-question-dialog
|
|
- v-if="gptQuestionEnable"
|
|
|
|
ref="GptQuestionDialog"
|
|
ref="GptQuestionDialog"
|
|
:course="{
|
|
:course="{
|
|
courseId: curCourse.id,
|
|
courseId: curCourse.id,
|
|
@@ -368,6 +367,7 @@ import {
|
|
checkGptQuestionEnableApi,
|
|
checkGptQuestionEnableApi,
|
|
aiQuestionConfirmApi,
|
|
aiQuestionConfirmApi,
|
|
classifyQuestionPageListApi,
|
|
classifyQuestionPageListApi,
|
|
|
|
+ getAiNums,
|
|
} from "../api";
|
|
} from "../api";
|
|
import QuestionStatisticsDialog from "../components/QuestionStatisticsDialog.vue";
|
|
import QuestionStatisticsDialog from "../components/QuestionStatisticsDialog.vue";
|
|
import QuestionSafetySetDialog from "../components/QuestionSafetySetDialog.vue";
|
|
import QuestionSafetySetDialog from "../components/QuestionSafetySetDialog.vue";
|
|
@@ -430,6 +430,7 @@ export default {
|
|
questionImportData: {},
|
|
questionImportData: {},
|
|
gptQuestionEnable: false,
|
|
gptQuestionEnable: false,
|
|
curActionQids: [],
|
|
curActionQids: [],
|
|
|
|
+ aiWarningMsg: "",
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -462,7 +463,19 @@ export default {
|
|
...mapActions([USER_SIGNIN]),
|
|
...mapActions([USER_SIGNIN]),
|
|
async checkGptEnable() {
|
|
async checkGptEnable() {
|
|
const res = await checkGptQuestionEnableApi();
|
|
const res = await checkGptQuestionEnableApi();
|
|
- this.gptQuestionEnable = res.data;
|
|
|
|
|
|
+ // this.gptQuestionEnable = res.data;
|
|
|
|
+ if (res.data) {
|
|
|
|
+ let result = await getAiNums({
|
|
|
|
+ rootOrgId: this.$store.state.user.rootOrgId,
|
|
|
|
+ });
|
|
|
|
+ if (result?.data?.leftCount == 0) {
|
|
|
|
+ this.aiWarningMsg =
|
|
|
|
+ "AI命题出题包已经用完,请联系教务处老师购买试题包后再出题";
|
|
|
|
+ }
|
|
|
|
+ console.log("result", result);
|
|
|
|
+ } else {
|
|
|
|
+ this.aiWarningMsg = "未开通AI命题功能,请联系教务处老师进行开通";
|
|
|
|
+ }
|
|
},
|
|
},
|
|
toPage(page) {
|
|
toPage(page) {
|
|
this.currentPage = page;
|
|
this.currentPage = page;
|
|
@@ -666,6 +679,10 @@ export default {
|
|
this.$refs.QuestionImportEdit.open();
|
|
this.$refs.QuestionImportEdit.open();
|
|
},
|
|
},
|
|
async toGPTQuestion() {
|
|
async toGPTQuestion() {
|
|
|
|
+ // if (this.aiWarningMsg) {
|
|
|
|
+ // this.$message.error(this.aiWarningMsg);
|
|
|
|
+ // return;
|
|
|
|
+ // }
|
|
if (!this.filter.courseId) {
|
|
if (!this.filter.courseId) {
|
|
this.$message.error("请先选择课程!");
|
|
this.$message.error("请先选择课程!");
|
|
return;
|
|
return;
|