This commit is contained in:
icssoa 2021-11-08 17:14:16 +08:00
parent db2a2d71c9
commit 2610677c34
2 changed files with 29 additions and 22 deletions

View File

@ -1,17 +1,18 @@
<template> <template>
<div class="cl-menu-tree"> <el-popover
<el-popover :visible="visible"
placement="bottom-start" placement="bottom-start"
trigger="click" trigger="click"
width="500px" width="500px"
popper-class="popper-menu-tree" popper-class="cl-menu-tree"
> >
<el-input v-model="keyword" size="small"> <el-input v-model="keyword" size="small">
<template #prefix> <template #prefix>
<i class="el-input__icon el-icon-search"></i> <i class="el-input__icon el-icon-search"></i>
</template> </template>
</el-input> </el-input>
<div class="cl-menu-tree__scroller scroller1">
<el-tree <el-tree
ref="treeRef" ref="treeRef"
node-key="menuId" node-key="menuId"
@ -26,12 +27,12 @@
:filter-node-method="filterNode" :filter-node-method="filterNode"
@current-change="onCurrentChange" @current-change="onCurrentChange"
/> />
</div>
<template #reference> <template #reference>
<el-input v-model="name" readonly placeholder="请选择" /> <el-input v-model="name" readonly placeholder="请选择" @click="visible = true" />
</template> </template>
</el-popover> </el-popover>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -54,6 +55,8 @@ export default defineComponent({
// //
const keyword = ref<string>(""); const keyword = ref<string>("");
const visible = ref<boolean>(false);
// //
const list = ref<any[]>([]); const list = ref<any[]>([]);
@ -66,6 +69,7 @@ export default defineComponent({
// //
function onCurrentChange({ id }: any) { function onCurrentChange({ id }: any) {
emit("update:modelValue", id); emit("update:modelValue", id);
visible.value = false;
} }
// //
@ -107,6 +111,7 @@ export default defineComponent({
}); });
return { return {
visible,
keyword, keyword,
list, list,
expandedKeys, expandedKeys,
@ -122,11 +127,16 @@ export default defineComponent({
</script> </script>
<style lang="scss"> <style lang="scss">
.popper-menu-tree { .cl-menu-tree {
box-sizing: border-box; box-sizing: border-box;
.el-input { .el-input {
margin-bottom: 10px; margin-bottom: 10px;
} }
&__scroller {
max-height: 400px;
overflow: hidden auto;
}
} }
</style> </style>

View File

@ -1,9 +1,6 @@
import { BaseService, Service, Permission } from "/@/core"; import { BaseService, Service, Permission } from "/@/core";
@Service({ @Service("base/sys/department")
namespace: "base/sys/department",
proxy: "/dev"
})
class SysDepartment extends BaseService { class SysDepartment extends BaseService {
@Permission("order") @Permission("order")
order(data: any) { order(data: any) {