|
@@ -8,6 +8,7 @@
|
|
|
:close-on-press-escape="false"
|
|
|
append-to-body
|
|
|
fullscreen
|
|
|
+ custom-class="folder-question-manage-dialog"
|
|
|
>
|
|
|
<div class="folder-question">
|
|
|
<div class="folder-list">
|
|
@@ -17,7 +18,7 @@
|
|
|
@selected="folderFilterSelected"
|
|
|
></question-folder>
|
|
|
</div>
|
|
|
- <div class="question-list part-box">
|
|
|
+ <div class="question-list">
|
|
|
<el-form class="part-filter-form" :inline="true" :model="filter">
|
|
|
<el-form-item label="课程名称">
|
|
|
<course-select v-model="filter.courseId"> </course-select>
|
|
@@ -26,25 +27,11 @@
|
|
|
<question-type-select v-model="filter.quesStructType">
|
|
|
</question-type-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="属性名">
|
|
|
- <property-select
|
|
|
- v-model="filter.coursePropertyId"
|
|
|
+ <el-form-item label="属性">
|
|
|
+ <property-tree-select
|
|
|
+ v-model="filter.propertyIdList"
|
|
|
:course-id="filter.courseId"
|
|
|
- ></property-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="一级属性">
|
|
|
- <property-sub-select
|
|
|
- v-model="filter.firstPropertyId"
|
|
|
- :parent-id="filter.coursePropertyId"
|
|
|
- data-type="first"
|
|
|
- ></property-sub-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="二级属性">
|
|
|
- <property-sub-select
|
|
|
- v-model="filter.secondPropertyId"
|
|
|
- :parent-id="filter.firstPropertyId"
|
|
|
- data-type="second"
|
|
|
- ></property-sub-select>
|
|
|
+ ></property-tree-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
@@ -54,13 +41,25 @@
|
|
|
|
|
|
<div class="part-box-action">
|
|
|
<div>
|
|
|
- <el-button type="primary" plain @click="toBatchMove"
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="el-icon-position"
|
|
|
+ @click="toBatchMove"
|
|
|
>移动</el-button
|
|
|
>
|
|
|
- <el-button type="danger" plain @click="toBatchCopy"
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="el-icon-copy-document"
|
|
|
+ @click="toBatchCopy"
|
|
|
>复制</el-button
|
|
|
>
|
|
|
- <el-button type="danger" plain @click="toBatchDelete"
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ plain
|
|
|
+ icon="el-icon-circle-close"
|
|
|
+ @click="toBatchDelete"
|
|
|
>删除</el-button
|
|
|
>
|
|
|
</div>
|
|
@@ -98,12 +97,11 @@
|
|
|
<span>{{ scope.row.questionType | questionType }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="难度" width="80"> </el-table-column>
|
|
|
- <el-table-column label="使用量" width="80"> </el-table-column>
|
|
|
- <el-table-column label="创建人" width="120">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.creator }}</span>
|
|
|
- </template>
|
|
|
+ <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>
|
|
@@ -149,15 +147,6 @@
|
|
|
>删除</el-button
|
|
|
>
|
|
|
</el-dropdown-item>
|
|
|
- <el-dropdown-item>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- @click="toLinkQuestion(scope.row)"
|
|
|
- >关联属性</el-button
|
|
|
- >
|
|
|
- </el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
</div>
|
|
@@ -203,7 +192,7 @@
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
- questionPageListApi,
|
|
|
+ classifyQuestionPageListApi,
|
|
|
deleteQuestionApi,
|
|
|
moveQuestionApi,
|
|
|
copyQuestionApi,
|
|
@@ -212,6 +201,7 @@ import QuestionFolder from "./QuestionFolder.vue";
|
|
|
import QuestionEditDialog from "./QuestionEditDialog.vue";
|
|
|
import QuestionPreviewDialog from "./QuestionPreviewDialog.vue";
|
|
|
import QuestionFolderDialog from "./QuestionFolderDialog.vue";
|
|
|
+import PropertyTreeSelect from "../components/PropertyTreeSelect.vue";
|
|
|
|
|
|
export default {
|
|
|
name: "FolderQuestionManageDialog",
|
|
@@ -220,6 +210,7 @@ export default {
|
|
|
QuestionEditDialog,
|
|
|
QuestionPreviewDialog,
|
|
|
QuestionFolderDialog,
|
|
|
+ PropertyTreeSelect,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -228,9 +219,7 @@ export default {
|
|
|
classifyId: null,
|
|
|
courseId: "",
|
|
|
quesStructType: "",
|
|
|
- coursePropertyId: "",
|
|
|
- firstPropertyId: "",
|
|
|
- secondPropertyId: "",
|
|
|
+ propertyIdList: [],
|
|
|
},
|
|
|
questionList: [],
|
|
|
currentPage: 1,
|
|
@@ -258,11 +247,13 @@ export default {
|
|
|
async getList() {
|
|
|
this.selectedQuestionIds = [];
|
|
|
this.loading = true;
|
|
|
- const res = await questionPageListApi({
|
|
|
+ let data = {
|
|
|
...this.filter,
|
|
|
curPage: this.currentPage,
|
|
|
pageSize: this.pageSize,
|
|
|
- }).catch(() => {});
|
|
|
+ };
|
|
|
+ data.propertyIdList = data.propertyIdList.join();
|
|
|
+ const res = await classifyQuestionPageListApi(data).catch(() => {});
|
|
|
this.loading = false;
|
|
|
if (!res) return;
|
|
|
this.questionList = res.data.content;
|
|
@@ -296,8 +287,14 @@ export default {
|
|
|
this.$refs.QuestionFolderDialog.open();
|
|
|
},
|
|
|
async moveQuestion(folder) {
|
|
|
+ if (folder.id === this.curFolder.id) {
|
|
|
+ this.$message.error("内容就在当前当前文件中");
|
|
|
+ return;
|
|
|
+ }
|
|
|
let res = null;
|
|
|
- res = await moveQuestionApi(this.curMoveQids, folder.id).catch(() => {});
|
|
|
+ res = await moveQuestionApi(this.curMoveQids.join(), folder.id).catch(
|
|
|
+ () => {}
|
|
|
+ );
|
|
|
|
|
|
if (!res) return;
|
|
|
this.$message.success("操作成功!");
|
|
@@ -319,7 +316,7 @@ export default {
|
|
|
},
|
|
|
async deleteQuestion(ids) {
|
|
|
this.loading = true;
|
|
|
- const res = await deleteQuestionApi(ids).catch((error) => {
|
|
|
+ const res = await deleteQuestionApi(ids.join()).catch((error) => {
|
|
|
this.$notify({
|
|
|
message: error.response.data.desc,
|
|
|
type: "error",
|
|
@@ -340,6 +337,7 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
this.curMoveQids = [...this.selectedQuestionIds];
|
|
|
+ this.$refs.QuestionFolderDialog.open();
|
|
|
},
|
|
|
toBatchCopy() {
|
|
|
if (!this.selectedQuestionIds.length) {
|
|
@@ -361,9 +359,6 @@ export default {
|
|
|
|
|
|
this.deleteQuestion(this.selectedQuestionIds);
|
|
|
},
|
|
|
- toLinkQuestion(row) {
|
|
|
- console.log(row);
|
|
|
- },
|
|
|
toAddFolder() {
|
|
|
this.curFolder = { parentId: this.filter.classifyId };
|
|
|
this.$refs.ModifyFolder.open();
|