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>
|
</el-tooltip>
|
||||||
</div>
|
</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">
|
<div class="data" v-loading="loading">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<!-- 树类型 -->
|
<!-- 树类型 -->
|
||||||
@ -173,6 +186,7 @@ const config = reactive(
|
|||||||
service: {},
|
service: {},
|
||||||
enableContextMenu: true,
|
enableContextMenu: true,
|
||||||
enableRefresh: true,
|
enableRefresh: true,
|
||||||
|
enableKeySearch: true,
|
||||||
enableAdd: true,
|
enableAdd: true,
|
||||||
custom: false
|
custom: false
|
||||||
},
|
},
|
||||||
@ -190,6 +204,9 @@ if (isEmpty(config.service) && !isCustom) {
|
|||||||
// 加载中
|
// 加载中
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 搜索关键字
|
||||||
|
const keyWord = ref("");
|
||||||
|
|
||||||
// 列表
|
// 列表
|
||||||
const list = ref<ClViewGroup.Item[]>([]);
|
const list = ref<ClViewGroup.Item[]>([]);
|
||||||
|
|
||||||
@ -331,10 +348,11 @@ async function refresh(params?: any) {
|
|||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
...reqParams,
|
...reqParams,
|
||||||
...config.data
|
...config.data,
|
||||||
|
keyWord: keyWord.value
|
||||||
};
|
};
|
||||||
|
|
||||||
let req;
|
let req: Promise<void>;
|
||||||
|
|
||||||
if (tree.visible) {
|
if (tree.visible) {
|
||||||
// 树形数据
|
// 树形数据
|
||||||
@ -478,6 +496,8 @@ defineExpose({
|
|||||||
}
|
}
|
||||||
|
|
||||||
.scope {
|
.scope {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@ -509,8 +529,14 @@ defineExpose({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search {
|
||||||
|
height: 40px;
|
||||||
|
padding: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.data {
|
.data {
|
||||||
height: calc(100% - 40px);
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
:deep(.el-tree-node__content) {
|
: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;
|
enableContextMenu?: boolean;
|
||||||
enableAdd?: boolean;
|
enableAdd?: boolean;
|
||||||
enableRefresh?: boolean;
|
enableRefresh?: boolean;
|
||||||
|
enableKeySearch?: boolean;
|
||||||
custom?: boolean;
|
custom?: boolean;
|
||||||
onSelect?(item: M<T>): void;
|
onSelect?(item: M<T>): void;
|
||||||
onEdit?(item?: M<T>): DeepPartial<ClForm.Options>;
|
onEdit?(item?: M<T>): DeepPartial<ClForm.Options>;
|
||||||
|
Loading…
Reference in New Issue
Block a user