mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-02-06 02:25:30 +08:00
JeecgBoot 3.1.0 版本发布,基于代码生成器的企业级低代码平台
This commit is contained in:
@ -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) {
|
||||
|
||||
@ -28,14 +28,23 @@
|
||||
</a-col>
|
||||
<a-col :md="18" :sm="24">
|
||||
<a-card :bordered="false">
|
||||
用户账号:
|
||||
<a-input-search
|
||||
:style="{width:'150px',marginBottom:'15px'}"
|
||||
placeholder="请输入账号"
|
||||
v-model="queryParam.username"
|
||||
@search="onSearch"
|
||||
></a-input-search>
|
||||
<a-button @click="searchReset(1)" style="margin-left: 20px" icon="redo">重置</a-button>
|
||||
<a-form-model>
|
||||
<a-form-model-item label="用户账号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-row type="flex" :gutter="8">
|
||||
<a-col :span="18">
|
||||
<a-input-search
|
||||
:style="{width:'100%'}"
|
||||
placeholder="请输入账号"
|
||||
v-model="queryParam.username"
|
||||
@search="onSearch"
|
||||
></a-input-search>
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<a-button @click="searchReset(1)" icon="redo">重置</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
<!--用户列表-->
|
||||
<a-table
|
||||
ref="table"
|
||||
@ -133,6 +142,14 @@
|
||||
form: this.$form.createForm(this),
|
||||
loading: false,
|
||||
expandedKeys: [],
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 4 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 10 },
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
Reference in New Issue
Block a user