|
@@ -463,7 +463,7 @@
|
|
|
<el-dialog
|
|
|
title="选择题目"
|
|
|
:visible.sync="projectDialogVisible"
|
|
|
- width="900px"
|
|
|
+ width="1000px"
|
|
|
append-to-body
|
|
|
@close="cancelSelectProject"
|
|
|
:close-on-click-modal="false">
|
|
@@ -473,10 +473,9 @@
|
|
|
<div class="tree-fixed-header">
|
|
|
<el-input
|
|
|
placeholder="请输入分类名称"
|
|
|
- v-model="projectQueryParams.cateName"
|
|
|
+ v-model="categoryFilterText"
|
|
|
size="small"
|
|
|
clearable
|
|
|
- @input="initCategoryTree"
|
|
|
prefix-icon="el-icon-search">
|
|
|
</el-input>
|
|
|
</div>
|
|
@@ -486,6 +485,7 @@
|
|
|
:data="categoryTreeData"
|
|
|
node-key="cateId"
|
|
|
highlight-current
|
|
|
+ :filter-node-method="filterNode"
|
|
|
:props="{ label: 'cateName', children: 'children' }"
|
|
|
@node-click="handleCategoryClick"
|
|
|
:expand-on-click-node="false"
|
|
@@ -512,6 +512,7 @@
|
|
|
height="350"
|
|
|
:data="projectList"
|
|
|
row-key="id"
|
|
|
+ v-loading="projectLoading"
|
|
|
border
|
|
|
@select="handleProjectSelect"
|
|
|
@select-all="handleProjectSelect">
|
|
@@ -706,11 +707,13 @@ export default {
|
|
|
questionType: null,
|
|
|
title: null
|
|
|
},
|
|
|
+ projectLoading: false,
|
|
|
projectListTotal: 0,
|
|
|
selectedProjectIds: [],
|
|
|
selectedType: 0,
|
|
|
currentRow: null,
|
|
|
// 分类树相关数据
|
|
|
+ categoryFilterText: '',
|
|
|
categoryTreeData: [],
|
|
|
add: false,
|
|
|
// 题目列表
|
|
@@ -731,6 +734,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ categoryFilterText(val) {
|
|
|
+ this.$refs.categoryTree.filter(val);
|
|
|
+ }
|
|
|
+ },
|
|
|
created() {
|
|
|
this.getTypeList();
|
|
|
this.getList();
|
|
@@ -1232,6 +1240,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
getProjectList() {
|
|
|
+ this.projectLoading = true
|
|
|
listCourseQuestionBank(this.projectQueryParams).then(response => {
|
|
|
this.projectList = response.rows;
|
|
|
this.projectListTotal = response.total;
|
|
@@ -1252,6 +1261,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ this.projectLoading = false
|
|
|
});
|
|
|
},
|
|
|
/** 打开项目选择弹窗 */
|
|
@@ -1364,15 +1374,19 @@ export default {
|
|
|
/** 初始化分类树 */
|
|
|
initCategoryTree(name) {
|
|
|
// 获取分类列表
|
|
|
- listUserCourseCategory({cateName: name}).then(response => {
|
|
|
+ listUserCourseCategory().then(response => {
|
|
|
+ const treeDate = this.handleTree(response.data, "cateId", "pid");
|
|
|
this.categoryTreeData = [{
|
|
|
cateId: 0,
|
|
|
cateName: '全部',
|
|
|
- children: response.data
|
|
|
+ children: treeDate
|
|
|
}];
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
+ filterNode(value, data) {
|
|
|
+ if (!value) return true;
|
|
|
+ return data.cateName.indexOf(value) !== -1;
|
|
|
+ },
|
|
|
/** 处理分类点击 */
|
|
|
handleCategoryClick(data) {
|
|
|
// 更新查询参数
|
|
@@ -1591,6 +1605,7 @@ export default {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
overflow: hidden;
|
|
|
+ flex-shrink: 0;
|
|
|
}
|
|
|
|
|
|
.tree-fixed-header {
|
|
@@ -1613,6 +1628,7 @@ export default {
|
|
|
height: 100%;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
+ width: calc(100% - 250px); /* 固定宽度为剩余空间 */
|
|
|
}
|
|
|
|
|
|
.project-list .filter-container {
|