|
@@ -20,9 +20,13 @@
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="属性">
|
|
<el-form-item label="属性">
|
|
- <property-tree-select
|
|
|
|
|
|
+ <!-- <property-tree-select
|
|
v-model="filter.questionProperty"
|
|
v-model="filter.questionProperty"
|
|
:course-id="filter.courseId"
|
|
:course-id="filter.courseId"
|
|
|
|
+ ></property-tree-select> -->
|
|
|
|
+ <property-tree-select
|
|
|
|
+ v-model="filter.propertyIdList"
|
|
|
|
+ :course-id="filter.courseId"
|
|
></property-tree-select>
|
|
></property-tree-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
@@ -62,6 +66,20 @@
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ icon="el-icon-position"
|
|
|
|
+ @click="toBatchMove"
|
|
|
|
+ >移动</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ icon="el-icon-copy-document"
|
|
|
|
+ @click="toBatchCopy"
|
|
|
|
+ >复制</el-button
|
|
|
|
+ >
|
|
<el-button
|
|
<el-button
|
|
type="danger"
|
|
type="danger"
|
|
plain
|
|
plain
|
|
@@ -120,101 +138,110 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div class="part-box">
|
|
|
|
- <el-table
|
|
|
|
- v-loading="loading"
|
|
|
|
- element-loading-text="加载中"
|
|
|
|
- :data="questionList"
|
|
|
|
- @selection-change="tableSelectChange"
|
|
|
|
- >
|
|
|
|
- <el-table-column
|
|
|
|
- type="selection"
|
|
|
|
- width="50"
|
|
|
|
- align="center"
|
|
|
|
- ></el-table-column>
|
|
|
|
- <el-table-column label="题干" min-width="200">
|
|
|
|
- <div slot-scope="scope" @click="toViewQuestion(scope.row)">
|
|
|
|
- <rich-text
|
|
|
|
- class="row-question-body"
|
|
|
|
- title="点击查看试题"
|
|
|
|
- :text-json="scope.row.quesBody"
|
|
|
|
- ></rich-text>
|
|
|
|
- </div>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="课程" width="120">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <span>{{ scope.row.course.name }}</span>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="题型" prop="sourceDetailName" width="100">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="难度" prop="difficulty" width="80">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="使用量" prop="usageAmount" width="80">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="创建人" prop="creator" width="120">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="创建时间" width="170" prop="creationTime">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="操作" width="180" fixed="right">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <div class="operate_left">
|
|
|
|
- <el-button
|
|
|
|
- size="mini"
|
|
|
|
- type="primary"
|
|
|
|
- plain
|
|
|
|
- @click="toEditQuestion(scope.row)"
|
|
|
|
- >编辑</el-button
|
|
|
|
- >
|
|
|
|
- <el-dropdown>
|
|
|
|
- <el-button type="primary" size="mini" plain>
|
|
|
|
- 更多 <i class="el-icon-more el-icon--right"></i>
|
|
|
|
- </el-button>
|
|
|
|
- <el-dropdown-menu slot="dropdown" class="action-dropdown">
|
|
|
|
- <el-dropdown-item>
|
|
|
|
- <el-button
|
|
|
|
- size="mini"
|
|
|
|
- type="primary"
|
|
|
|
- plain
|
|
|
|
- @click="toMoveQuestion(scope.row)"
|
|
|
|
- >移动</el-button
|
|
|
|
- >
|
|
|
|
- </el-dropdown-item>
|
|
|
|
- <el-dropdown-item>
|
|
|
|
- <el-button
|
|
|
|
- size="mini"
|
|
|
|
- type="primary"
|
|
|
|
- plain
|
|
|
|
- @click="toCopyQuestion(scope.row)"
|
|
|
|
- >复制</el-button
|
|
|
|
- >
|
|
|
|
- </el-dropdown-item>
|
|
|
|
- <el-dropdown-item>
|
|
|
|
- <el-button
|
|
|
|
- size="mini"
|
|
|
|
- type="danger"
|
|
|
|
- plain
|
|
|
|
- @click="toDeleteQuestion(scope.row)"
|
|
|
|
- >删除</el-button
|
|
|
|
- >
|
|
|
|
- </el-dropdown-item>
|
|
|
|
- </el-dropdown-menu>
|
|
|
|
- </el-dropdown>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
- <div class="part-page">
|
|
|
|
- <el-pagination
|
|
|
|
- :current-page="currentPage"
|
|
|
|
- :page-size="pageSize"
|
|
|
|
- :page-sizes="[10, 20, 50, 100, 200, 300]"
|
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
- :total="total"
|
|
|
|
- @current-change="toPage"
|
|
|
|
- @size-change="handleSizeChange"
|
|
|
|
|
|
+ <div class="folder-question">
|
|
|
|
+ <div class="folder-list">
|
|
|
|
+ <question-folder
|
|
|
|
+ ref="QuestionFolder"
|
|
|
|
+ is-edit
|
|
|
|
+ @selected="folderFilterSelected"
|
|
|
|
+ ></question-folder>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="question-list">
|
|
|
|
+ <el-table
|
|
|
|
+ v-loading="loading"
|
|
|
|
+ element-loading-text="加载中"
|
|
|
|
+ :data="questionList"
|
|
|
|
+ @selection-change="tableSelectChange"
|
|
>
|
|
>
|
|
- </el-pagination>
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ type="selection"
|
|
|
|
+ width="50"
|
|
|
|
+ align="center"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column label="题干" min-width="200">
|
|
|
|
+ <div slot-scope="scope" @click="toViewQuestion(scope.row)">
|
|
|
|
+ <rich-text
|
|
|
|
+ class="row-question-body"
|
|
|
|
+ title="点击查看试题"
|
|
|
|
+ :text-json="scope.row.quesBody"
|
|
|
|
+ ></rich-text>
|
|
|
|
+ </div>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="课程" width="120">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ scope.row.course.name }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="题型" prop="sourceDetailName" width="100">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="难度" prop="difficulty" width="80">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="使用量" prop="usageAmount" width="80">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="创建人" prop="creator" width="120">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="创建时间" width="170" prop="creationTime">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="操作" width="180" fixed="right">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div class="operate_left">
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ @click="toEditQuestion(scope.row)"
|
|
|
|
+ >编辑</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-dropdown>
|
|
|
|
+ <el-button type="primary" size="mini" plain>
|
|
|
|
+ 更多 <i class="el-icon-more el-icon--right"></i>
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-dropdown-menu slot="dropdown" class="action-dropdown">
|
|
|
|
+ <el-dropdown-item>
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ @click="toMoveQuestion(scope.row)"
|
|
|
|
+ >移动</el-button
|
|
|
|
+ >
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
+ <el-dropdown-item>
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ @click="toCopyQuestion(scope.row)"
|
|
|
|
+ >复制</el-button
|
|
|
|
+ >
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
+ <el-dropdown-item>
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="danger"
|
|
|
|
+ plain
|
|
|
|
+ @click="toDeleteQuestion(scope.row)"
|
|
|
|
+ >删除</el-button
|
|
|
|
+ >
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
+ </el-dropdown-menu>
|
|
|
|
+ </el-dropdown>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ <div class="part-page">
|
|
|
|
+ <el-pagination
|
|
|
|
+ :current-page="currentPage"
|
|
|
|
+ :page-size="pageSize"
|
|
|
|
+ :page-sizes="[10, 20, 50, 100, 200, 300]"
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
+ :total="total"
|
|
|
|
+ @current-change="toPage"
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
+ >
|
|
|
|
+ </el-pagination>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -275,12 +302,13 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import {
|
|
import {
|
|
- questionPageListApi,
|
|
|
|
|
|
+ // questionPageListApi,
|
|
deleteQuestionApi,
|
|
deleteQuestionApi,
|
|
moveQuestionApi,
|
|
moveQuestionApi,
|
|
copyQuestionApi,
|
|
copyQuestionApi,
|
|
checkGptQuestionEnableApi,
|
|
checkGptQuestionEnableApi,
|
|
aiQuestionConfirmApi,
|
|
aiQuestionConfirmApi,
|
|
|
|
+ classifyQuestionPageListApi,
|
|
} 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";
|
|
@@ -294,6 +322,7 @@ import QuestionImportEdit from "../components/QuestionImportEdit.vue";
|
|
import GptQuestionDialog from "../components/GptQuestionDialog.vue";
|
|
import GptQuestionDialog from "../components/GptQuestionDialog.vue";
|
|
import { mapActions } from "vuex";
|
|
import { mapActions } from "vuex";
|
|
import { USER_SIGNIN } from "../../portal/store/user";
|
|
import { USER_SIGNIN } from "../../portal/store/user";
|
|
|
|
+import QuestionFolder from "@/modules/question/components/QuestionFolder.vue";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "QuestionMamage",
|
|
name: "QuestionMamage",
|
|
@@ -308,6 +337,7 @@ export default {
|
|
PropertyTreeSelect,
|
|
PropertyTreeSelect,
|
|
QuestionImportEdit,
|
|
QuestionImportEdit,
|
|
GptQuestionDialog,
|
|
GptQuestionDialog,
|
|
|
|
+ QuestionFolder,
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -316,7 +346,14 @@ export default {
|
|
questionType: "",
|
|
questionType: "",
|
|
sourceDetailId: "",
|
|
sourceDetailId: "",
|
|
questionBody: "",
|
|
questionBody: "",
|
|
- questionProperty: [],
|
|
|
|
|
|
+ // questionProperty: [],
|
|
|
|
+ propertyIdList: [],
|
|
|
|
+
|
|
|
|
+ classifyId: "",
|
|
|
|
+ // courseId: "",
|
|
|
|
+ // questionType: "",
|
|
|
|
+ // sourceDetailId: "",
|
|
|
|
+ // propertyIdList: [],
|
|
},
|
|
},
|
|
curFolderAction: "",
|
|
curFolderAction: "",
|
|
folderList: [],
|
|
folderList: [],
|
|
@@ -332,6 +369,7 @@ export default {
|
|
curMoveType: "",
|
|
curMoveType: "",
|
|
questionImportData: {},
|
|
questionImportData: {},
|
|
gptQuestionEnable: false,
|
|
gptQuestionEnable: false,
|
|
|
|
+ curActionQids: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -340,10 +378,26 @@ export default {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
|
|
+ this.$refs.QuestionFolder.selectDefaultNode();
|
|
|
|
+
|
|
this.checkGptEnable();
|
|
this.checkGptEnable();
|
|
this.toPage(1);
|
|
this.toPage(1);
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ folderFilterSelected(folder) {
|
|
|
|
+ console.log("left tree choose folder:", folder);
|
|
|
|
+ if (!folder) return;
|
|
|
|
+
|
|
|
|
+ this.curFolder = folder;
|
|
|
|
+ this.filter = {
|
|
|
|
+ classifyId: folder.id,
|
|
|
|
+ courseId: "",
|
|
|
|
+ questionType: "",
|
|
|
|
+ sourceDetailId: "",
|
|
|
|
+ propertyIdList: [],
|
|
|
|
+ };
|
|
|
|
+ this.toPage(1);
|
|
|
|
+ },
|
|
...mapActions([USER_SIGNIN]),
|
|
...mapActions([USER_SIGNIN]),
|
|
async checkGptEnable() {
|
|
async checkGptEnable() {
|
|
const res = await checkGptQuestionEnableApi();
|
|
const res = await checkGptQuestionEnableApi();
|
|
@@ -358,11 +412,14 @@ export default {
|
|
this.selectedQuestionIds = [];
|
|
this.selectedQuestionIds = [];
|
|
let data = {
|
|
let data = {
|
|
...this.filter,
|
|
...this.filter,
|
|
- pageNumber: this.currentPage,
|
|
|
|
|
|
+ // pageNumber: this.currentPage,
|
|
|
|
+ curPage: this.currentPage,
|
|
pageSize: this.pageSize,
|
|
pageSize: this.pageSize,
|
|
};
|
|
};
|
|
- data.questionProperty = data.questionProperty.join();
|
|
|
|
- const res = await questionPageListApi(data).catch(() => {});
|
|
|
|
|
|
+ // data.questionProperty = data.questionProperty.join();
|
|
|
|
+ data.propertyIdList = data.propertyIdList.join();
|
|
|
|
+ // const res = await questionPageListApi(data).catch(() => {});
|
|
|
|
+ const res = await classifyQuestionPageListApi(data).catch(() => {});
|
|
this.loading = false;
|
|
this.loading = false;
|
|
if (!res) return;
|
|
if (!res) return;
|
|
this.questionList = res.data.content;
|
|
this.questionList = res.data.content;
|
|
@@ -432,23 +489,38 @@ export default {
|
|
this.$refs.QuestionEditDialog.open();
|
|
this.$refs.QuestionEditDialog.open();
|
|
},
|
|
},
|
|
toMoveQuestion(row) {
|
|
toMoveQuestion(row) {
|
|
- this.curQuestion = row;
|
|
|
|
|
|
+ // this.curQuestion = row;
|
|
|
|
+ this.curActionQids = [row.id];
|
|
this.curFolderAction = "move";
|
|
this.curFolderAction = "move";
|
|
this.$refs.QuestionFolderDialog.open();
|
|
this.$refs.QuestionFolderDialog.open();
|
|
},
|
|
},
|
|
toCopyQuestion(row) {
|
|
toCopyQuestion(row) {
|
|
- this.curQuestion = row;
|
|
|
|
|
|
+ // this.curQuestion = row;
|
|
|
|
+ this.curActionQids = [row.id];
|
|
this.curFolderAction = "copy";
|
|
this.curFolderAction = "copy";
|
|
this.$refs.QuestionFolderDialog.open();
|
|
this.$refs.QuestionFolderDialog.open();
|
|
},
|
|
},
|
|
async folderSelected(folder) {
|
|
async folderSelected(folder) {
|
|
|
|
+ if (folder.id === this.curFolder.id && this.curFolderAction === "move") {
|
|
|
|
+ this.$message.error("内容就在当前当前文件中");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
let res = null;
|
|
let res = null;
|
|
|
|
+ // if (this.curFolderAction === "move") {
|
|
|
|
+ // res = await moveQuestionApi(this.curQuestion.id, folder.id).catch(
|
|
|
|
+ // () => {}
|
|
|
|
+ // );
|
|
|
|
+ // } else {
|
|
|
|
+ // res = await copyQuestionApi(this.curQuestion.id, folder.id).catch(
|
|
|
|
+ // () => {}
|
|
|
|
+ // );
|
|
|
|
+ // }
|
|
if (this.curFolderAction === "move") {
|
|
if (this.curFolderAction === "move") {
|
|
- res = await moveQuestionApi(this.curQuestion.id, folder.id).catch(
|
|
|
|
|
|
+ res = await moveQuestionApi(this.curActionQids.join(), folder.id).catch(
|
|
() => {}
|
|
() => {}
|
|
);
|
|
);
|
|
} else {
|
|
} else {
|
|
- res = await copyQuestionApi(this.curQuestion.id, folder.id).catch(
|
|
|
|
|
|
+ res = await copyQuestionApi(this.curActionQids.join(), folder.id).catch(
|
|
() => {}
|
|
() => {}
|
|
);
|
|
);
|
|
}
|
|
}
|
|
@@ -477,6 +549,24 @@ export default {
|
|
|
|
|
|
this.deleteQuestion([row.id]);
|
|
this.deleteQuestion([row.id]);
|
|
},
|
|
},
|
|
|
|
+ toBatchMove() {
|
|
|
|
+ if (!this.selectedQuestionIds.length) {
|
|
|
|
+ this.$message.error("请选择试题!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.curActionQids = [...this.selectedQuestionIds];
|
|
|
|
+ this.curFolderAction = "move";
|
|
|
|
+ this.$refs.QuestionFolderDialog.open();
|
|
|
|
+ },
|
|
|
|
+ toBatchCopy() {
|
|
|
|
+ if (!this.selectedQuestionIds.length) {
|
|
|
|
+ this.$message.error("请选择试题!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.curActionQids = [...this.selectedQuestionIds];
|
|
|
|
+ this.curFolderAction = "copy";
|
|
|
|
+ this.$refs.QuestionFolderDialog.open();
|
|
|
|
+ },
|
|
async toBatchDelete() {
|
|
async toBatchDelete() {
|
|
if (!this.selectedQuestionIds.length) {
|
|
if (!this.selectedQuestionIds.length) {
|
|
this.$message.error("请选择试题!");
|
|
this.$message.error("请选择试题!");
|
|
@@ -503,6 +593,7 @@ export default {
|
|
this.getList();
|
|
this.getList();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ console.log("questionImported data", data);
|
|
this.questionImportData = data;
|
|
this.questionImportData = data;
|
|
this.$refs.QuestionImportEdit.open();
|
|
this.$refs.QuestionImportEdit.open();
|
|
},
|
|
},
|
|
@@ -531,3 +622,10 @@ export default {
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+.content {
|
|
|
|
+ .folder-question {
|
|
|
|
+ min-height: calc(100vh - 306px);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|