JeecgBoot 3.1.0 版本发布,基于代码生成器的企业级低代码平台

This commit is contained in:
zhangdaiscott
2022-02-24 15:13:05 +08:00
parent 84218c7fee
commit 9a3deba51b
304 changed files with 40313 additions and 230872 deletions

View File

@ -11,11 +11,13 @@
switchFullscreen
cancelText="关闭">
<a-spin tip="Loading..." :spinning="false">
<a-input-search style="margin-bottom: 1px" placeholder="请输入部门名称按回车进行搜索" @search="onSearch" />
<a-input-search v-model="searchValue" style="margin-bottom: 1px" placeholder="请输入部门名称按回车进行搜索" />
<a-empty v-if="filterTreeData.length===0"></a-empty>
<a-tree
v-else
checkable
:class="treeScreenClass"
:treeData="treeData"
:treeData="filterTreeData"
:checkStrictly="checkStrictly"
@check="onCheck"
@select="onSelect"
@ -24,14 +26,6 @@
:expandedKeys="expandedKeys"
:checkedKeys="checkedKeys">
<template slot="title" slot-scope="{title}">
<span v-if="title.indexOf(searchValue) > -1">
{{title.substr(0, title.indexOf(searchValue))}}
<span style="color: #f50">{{searchValue}}</span>
{{title.substr(title.indexOf(searchValue) + searchValue.length)}}
</span>
<span v-else>{{title}}</span>
</template>
</a-tree>
</a-spin>
<!--底部父子关联操作和确认取消按钮-->
@ -93,6 +87,18 @@
'fullscreen': this.fullscreen,
}
},
filterTreeData(){
if(!this.searchValue){
return this.treeData
}
let filter = []
this.dataList.forEach((item) => {
if (item.title.includes(this.searchValue)) {
filter.push(Object.assign({}, item, {children: null, isLeaf: true}))
}
})
return filter
},
},
methods:{
show(){
@ -228,22 +234,6 @@
}
}
return parentKey
},
onSearch(value){
const expandedKeys = this.dataList.map((item) => {
if (item.title.indexOf(value) > -1) {
return this.getParentKey(item.key,this.treeData)
}
return null
}).filter((item, i, self) => item && self.indexOf(item) === i)
Object.assign(this, {
expandedKeys,
searchValue: value,
autoExpandParent: true,
})
},
// 根据 checkedKeys 获取 rows
getCheckedRows(checkedKeys) {