|
@@ -10,11 +10,11 @@
|
|
|
</course-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="题型">
|
|
|
- <question-type-select v-model="filter.questionType">
|
|
|
+ <question-type-select v-model="filter.quesStructType">
|
|
|
</question-type-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="题目内容">
|
|
|
- <el-input v-model="filter.name" placeholder="题目内容"></el-input>
|
|
|
+ <el-input v-model="filter.content" placeholder="题目内容"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="属性名">
|
|
|
<property-select
|
|
@@ -63,7 +63,7 @@
|
|
|
type="primary"
|
|
|
plain
|
|
|
icon="el-icon-folder-opened"
|
|
|
- @click="toAddDir"
|
|
|
+ @click="toAddFolder"
|
|
|
>新建文件夹</el-button
|
|
|
>
|
|
|
<el-button
|
|
@@ -88,7 +88,40 @@
|
|
|
<el-table
|
|
|
v-loading="loading"
|
|
|
element-loading-text="加载中"
|
|
|
- :data="tableData"
|
|
|
+ :data="folderList"
|
|
|
+ >
|
|
|
+ <el-table-column prop="classifyName" label="文件名称">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="180" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ @click="toEditFolder(scope.row)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ @click="toMoveFolder(scope.row)"
|
|
|
+ >移动</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="danger"
|
|
|
+ plain
|
|
|
+ @click="toDeleteFolder(scope.row)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ element-loading-text="加载中"
|
|
|
+ :data="questionList"
|
|
|
>
|
|
|
<el-table-column
|
|
|
type="selection"
|
|
@@ -101,7 +134,7 @@
|
|
|
class="row-question-body"
|
|
|
title="点击查看试题"
|
|
|
:text-json="scope.row.quesBody"
|
|
|
- @click="toView(scope.row)"
|
|
|
+ @click="toViewQuestion(scope.row)"
|
|
|
></rich-text>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -131,7 +164,7 @@
|
|
|
size="mini"
|
|
|
type="primary"
|
|
|
plain
|
|
|
- @click="toEdit(scope.row)"
|
|
|
+ @click="toEditQuestion(scope.row)"
|
|
|
>编辑</el-button
|
|
|
>
|
|
|
<el-dropdown>
|
|
@@ -144,7 +177,7 @@
|
|
|
size="mini"
|
|
|
type="primary"
|
|
|
plain
|
|
|
- @click="toMove(scope.row)"
|
|
|
+ @click="toMoveQuestion(scope.row)"
|
|
|
>移动</el-button
|
|
|
>
|
|
|
</el-dropdown-item>
|
|
@@ -153,7 +186,7 @@
|
|
|
size="mini"
|
|
|
type="primary"
|
|
|
plain
|
|
|
- @click="toCopy(scope.row)"
|
|
|
+ @click="toCopyQuestion(scope.row)"
|
|
|
>复制</el-button
|
|
|
>
|
|
|
</el-dropdown-item>
|
|
@@ -162,7 +195,7 @@
|
|
|
size="mini"
|
|
|
type="danger"
|
|
|
plain
|
|
|
- @click="toDelete(scope.row)"
|
|
|
+ @click="toDeleteQuestion(scope.row)"
|
|
|
>删除</el-button
|
|
|
>
|
|
|
</el-dropdown-item>
|
|
@@ -171,7 +204,7 @@
|
|
|
size="mini"
|
|
|
type="primary"
|
|
|
plain
|
|
|
- @click="toLink(scope.row)"
|
|
|
+ @click="toLinkQuestion(scope.row)"
|
|
|
>关联属性</el-button
|
|
|
>
|
|
|
</el-dropdown-item>
|
|
@@ -213,7 +246,6 @@
|
|
|
<question-folder-dialog
|
|
|
ref="QuestionFolderDialog"
|
|
|
:is-edit="isEditFolder"
|
|
|
- :folder-id="curQuestionFolderId"
|
|
|
@selected="folderSelected"
|
|
|
></question-folder-dialog>
|
|
|
<!-- QuestionImportDialog -->
|
|
@@ -229,7 +261,9 @@ import {
|
|
|
questionPageListApi,
|
|
|
deleteQuestionApi,
|
|
|
moveQuestionApi,
|
|
|
+ moveClassifyApi,
|
|
|
copyQuestionApi,
|
|
|
+ deleteClassifyApi,
|
|
|
} from "../api";
|
|
|
import QuestionStatisticsDialog from "../components/QuestionStatisticsDialog.vue";
|
|
|
import QuestionSafetySetDialog from "../components/QuestionSafetySetDialog.vue";
|
|
@@ -249,22 +283,25 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
filter: {
|
|
|
+ classifyId: null,
|
|
|
courseId: "",
|
|
|
- questionType: "",
|
|
|
- name: "",
|
|
|
+ quesStructType: "",
|
|
|
+ content: "",
|
|
|
coursePropertyId: "",
|
|
|
firstPropertyId: "",
|
|
|
secondPropertyId: "",
|
|
|
},
|
|
|
- tableData: [],
|
|
|
+ folderList: [],
|
|
|
+ questionList: [],
|
|
|
currentPage: 1,
|
|
|
pageSize: 10,
|
|
|
total: 0,
|
|
|
loading: false,
|
|
|
isEditFolder: true,
|
|
|
- curQuestionFolderId: null,
|
|
|
curQuestion: {},
|
|
|
+ curFolder: {},
|
|
|
curCourse: {},
|
|
|
+ curMoveType: "",
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -277,13 +314,16 @@ export default {
|
|
|
},
|
|
|
async getList() {
|
|
|
this.loading = true;
|
|
|
- const res = await questionPageListApi(this.filter, {
|
|
|
- pageNo: this.currentPage,
|
|
|
+ const res = await questionPageListApi({
|
|
|
+ ...this.filter,
|
|
|
+ curPage: this.currentPage,
|
|
|
pageSize: this.pageSize,
|
|
|
- });
|
|
|
- this.tableData = res.data.content;
|
|
|
- this.total = res.data.totalElements;
|
|
|
+ }).catch(() => {});
|
|
|
this.loading = false;
|
|
|
+ if (!res) return;
|
|
|
+ this.folderList = res.data.questionClassifyResultList;
|
|
|
+ this.questionList = res.data.questionPageResult.content;
|
|
|
+ this.total = res.data.questionPageResult.totalElements;
|
|
|
},
|
|
|
handleSizeChange(val) {
|
|
|
this.pageSize = val;
|
|
@@ -302,9 +342,8 @@ export default {
|
|
|
toSafetySet() {
|
|
|
this.$refs.QuestionSafetySetDialog.open();
|
|
|
},
|
|
|
- toAddDir() {
|
|
|
+ toAddFolder() {
|
|
|
this.isEditFolder = true;
|
|
|
- this.curQuestionFolderId = null;
|
|
|
this.$refs.QuestionFolderDialog.open();
|
|
|
},
|
|
|
toCreateQuestion() {
|
|
@@ -322,39 +361,44 @@ export default {
|
|
|
toImportQuestion() {
|
|
|
this.$refs.QuestionImportDialog.open();
|
|
|
},
|
|
|
- toView(row) {
|
|
|
+ toViewQuestion(row) {
|
|
|
console.log(row);
|
|
|
},
|
|
|
- toEdit(row) {
|
|
|
+ toEditQuestion(row) {
|
|
|
console.log(row);
|
|
|
// todo:编辑试题
|
|
|
this.curQuestion = row;
|
|
|
this.$refs.QuestionEditDialog.open();
|
|
|
},
|
|
|
- toMove(row) {
|
|
|
+ toMoveQuestion(row) {
|
|
|
this.isEditFolder = false;
|
|
|
- this.curQuestionFolderId = row.foldId || null;
|
|
|
+ this.curMoveType = "question";
|
|
|
+ this.curQuestion = row;
|
|
|
this.$refs.QuestionFolderDialog.open();
|
|
|
},
|
|
|
async folderSelected(folder) {
|
|
|
- console.log(folder);
|
|
|
- const res = await moveQuestionApi(
|
|
|
- this.curQuestionFolderId,
|
|
|
- folder.id
|
|
|
- ).catch(() => {});
|
|
|
-
|
|
|
+ let res = null;
|
|
|
+ if (this.curMoveType === "question") {
|
|
|
+ res = await moveQuestionApi(this.curQuestion.id, folder.id).catch(
|
|
|
+ () => {}
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ res = await moveClassifyApi(this.curFolder.id, folder.id).catch(
|
|
|
+ () => {}
|
|
|
+ );
|
|
|
+ }
|
|
|
if (!res) return;
|
|
|
this.$message.success("操作成功!");
|
|
|
this.getList();
|
|
|
},
|
|
|
- async toCopy(row) {
|
|
|
+ async toCopyQuestion(row) {
|
|
|
console.log(row);
|
|
|
const res = await copyQuestionApi(row.id).catch(() => {});
|
|
|
if (!res) return;
|
|
|
this.$message.success("操作成功!");
|
|
|
this.getList();
|
|
|
},
|
|
|
- async toDelete(row) {
|
|
|
+ async toDeleteQuestion(row) {
|
|
|
const confirm = await this.$confirm("确认删除试题吗?", "提示", {
|
|
|
type: "warning",
|
|
|
}).catch(() => {});
|
|
@@ -376,8 +420,32 @@ export default {
|
|
|
});
|
|
|
this.getList();
|
|
|
},
|
|
|
- toLink(row) {
|
|
|
+ toLinkQuestion(row) {
|
|
|
+ console.log(row);
|
|
|
+ },
|
|
|
+ toEditFolder(row) {
|
|
|
+ console.log(row);
|
|
|
+ },
|
|
|
+ toMoveFolder(row) {
|
|
|
console.log(row);
|
|
|
+ this.isEditFolder = false;
|
|
|
+ this.curMoveType = "folder";
|
|
|
+ this.curFolder = row;
|
|
|
+ this.$refs.QuestionFolderDialog.open();
|
|
|
+ },
|
|
|
+ async toDeleteFolder(row) {
|
|
|
+ const confirm = await this.$confirm(`确定要删除选中的文件夹吗?`, "提示", {
|
|
|
+ type: "warning",
|
|
|
+ }).catch(() => {});
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
+
|
|
|
+ if (this.loading) return;
|
|
|
+ this.loading = true;
|
|
|
+ const res = await deleteClassifyApi(row.id).catch(() => {});
|
|
|
+ this.loading = false;
|
|
|
+ if (!res) return;
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ await this.getClassifyTree();
|
|
|
},
|
|
|
},
|
|
|
};
|