课件搜索调整
This commit is contained in:
parent
6ada0ac0c2
commit
942a557287
|
@ -25,7 +25,7 @@ export function handleScrollHeader(callback) {
|
||||||
let timer = 0
|
let timer = 0
|
||||||
|
|
||||||
let beforeScrollTop = window.pageYOffset
|
let beforeScrollTop = window.pageYOffset
|
||||||
callback = callback || function () { }
|
callback = callback || function() {}
|
||||||
window.addEventListener(
|
window.addEventListener(
|
||||||
'scroll',
|
'scroll',
|
||||||
event => {
|
event => {
|
||||||
|
@ -70,7 +70,7 @@ export function removeLoadingAnimate(id = '', timeout = 1500) {
|
||||||
export function listToTree(list, tree, parentId) {
|
export function listToTree(list, tree, parentId) {
|
||||||
list.map(item => {
|
list.map(item => {
|
||||||
const index = _.findIndex(list, ['id', item.pid])
|
const index = _.findIndex(list, ['id', item.pid])
|
||||||
if(index === -1){
|
if (index === -1) {
|
||||||
item.pid = 0
|
item.pid = 0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -101,14 +101,14 @@ export function dictToTree(list, tree, parentId) {
|
||||||
item_.title = item.name;
|
item_.title = item.name;
|
||||||
item_.value = item.value;
|
item_.value = item.value;
|
||||||
item_.key = item.id;
|
item_.key = item.id;
|
||||||
const child = { ...item_, children: [] };
|
const child = {...item_, children: [] };
|
||||||
|
|
||||||
dictToTree(list, child.children, item.value);
|
dictToTree(list, child.children, item.value);
|
||||||
|
|
||||||
if (child.children.length <= 0) {
|
if (child.children.length <= 0) {
|
||||||
delete child.children
|
delete child.children
|
||||||
} else {
|
} else {
|
||||||
child.selectable = false;
|
// child.selectable = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
tree.push(child)
|
tree.push(child)
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<!-- :disabled="tabDis" -->
|
<!-- :disabled="tabDis" -->
|
||||||
</a-menu>
|
</a-menu>
|
||||||
<!-- :defaultExpandedKeys="defaultExpandedKeys :replaceFields="replaceFields"" -->
|
<!-- :defaultExpandedKeys="defaultExpandedKeys :replaceFields="replaceFields"" -->
|
||||||
<a-tree :treeData="treeData" @select="onSelect" :defaultExpandAll="true" >
|
<a-tree :treeData="treeData" @select="onSelect" :defaultExpandAll="true" :replaceFields="replaceFields">
|
||||||
<a-icon slot="switcherIcon" type="down" />
|
<a-icon slot="switcherIcon" type="down" />
|
||||||
</a-tree>
|
</a-tree>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -88,7 +88,7 @@ export default {
|
||||||
menuKey: ['sys'], //默认系统课程
|
menuKey: ['sys'], //默认系统课程
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParam: { name: '', classType: 1, type: 1, tags: [] },
|
queryParam: { name: '', classType: 1, type: 1, tags: [] },
|
||||||
// replaceFields: { children: 'children', title: 'name', key: 'value', value: 'id' },
|
replaceFields: { children: 'children', title: 'title', key: 'value', value: 'key' },
|
||||||
expandedKeys: [],
|
expandedKeys: [],
|
||||||
autoExpandParent: true,
|
autoExpandParent: true,
|
||||||
dictCourseTag: [], //课程标签
|
dictCourseTag: [], //课程标签
|
||||||
|
|
Loading…
Reference in New Issue