mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2026-02-07 09:05:34 +00:00
优化
This commit is contained in:
parent
db2a2d71c9
commit
2610677c34
@ -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>
|
||||||
|
|||||||
@ -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) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user