mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 14:10:27 +08:00
优化
This commit is contained in:
parent
460e88dbae
commit
308f4447a4
@ -24,6 +24,19 @@
|
||||
</el-tooltip>
|
||||
</div>
|
||||
|
||||
<div class="search" v-if="config.enableKeySearch">
|
||||
<el-input
|
||||
placeholder="搜索关键字"
|
||||
v-model="keyWord"
|
||||
clearable
|
||||
@change="
|
||||
refresh({
|
||||
page: 1
|
||||
})
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="data" v-loading="loading">
|
||||
<el-scrollbar>
|
||||
<!-- 树类型 -->
|
||||
@ -173,6 +186,7 @@ const config = reactive(
|
||||
service: {},
|
||||
enableContextMenu: true,
|
||||
enableRefresh: true,
|
||||
enableKeySearch: true,
|
||||
enableAdd: true,
|
||||
custom: false
|
||||
},
|
||||
@ -190,6 +204,9 @@ if (isEmpty(config.service) && !isCustom) {
|
||||
// 加载中
|
||||
const loading = ref(false);
|
||||
|
||||
// 搜索关键字
|
||||
const keyWord = ref("");
|
||||
|
||||
// 列表
|
||||
const list = ref<ClViewGroup.Item[]>([]);
|
||||
|
||||
@ -331,10 +348,11 @@ async function refresh(params?: any) {
|
||||
|
||||
const data = {
|
||||
...reqParams,
|
||||
...config.data
|
||||
...config.data,
|
||||
keyWord: keyWord.value
|
||||
};
|
||||
|
||||
let req;
|
||||
let req: Promise<void>;
|
||||
|
||||
if (tree.visible) {
|
||||
// 树形数据
|
||||
@ -478,6 +496,8 @@ defineExpose({
|
||||
}
|
||||
|
||||
.scope {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
@ -509,8 +529,14 @@ defineExpose({
|
||||
}
|
||||
}
|
||||
|
||||
.search {
|
||||
height: 40px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.data {
|
||||
height: calc(100% - 40px);
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
|
||||
:deep(.el-tree-node__content) {
|
||||
|
1
src/plugins/view/types/index.d.ts
vendored
1
src/plugins/view/types/index.d.ts
vendored
@ -59,6 +59,7 @@ export declare namespace ClViewGroup {
|
||||
enableContextMenu?: boolean;
|
||||
enableAdd?: boolean;
|
||||
enableRefresh?: boolean;
|
||||
enableKeySearch?: boolean;
|
||||
custom?: boolean;
|
||||
onSelect?(item: M<T>): void;
|
||||
onEdit?(item?: M<T>): DeepPartial<ClForm.Options>;
|
||||
|
Loading…
Reference in New Issue
Block a user