Skip to content

Commit

Permalink
perf: 优化平铺查询模式下自定义按钮显示位置
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed Mar 22, 2021
1 parent 7853c58 commit 805bbff
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "element-pro-crud",
"version": "0.9.2-2",
"version": "0.9.2-3",
"author": "BoBo<[email protected]>",
"main": "lib/ProCrud.umd.min.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/component/crud-table/src/CrudTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
<slot name="append"></slot>
</template>
<template #btnBarPrevBtn>
<slot name="btnBarPrevBtn" />
<!-- 批量删除按钮 -->
<el-button v-if="view.btnDel" @click="btnDeletesOnClick" type="danger" size="mini" icon="el-icon-delete">{{ text.multiDel }}</el-button>
<!-- 添加按钮 -->
<el-button v-if="view.btnAdd" type="primary" icon="el-icon-plus" size="mini" @click.stop="btnAdd()">{{ text.add }}</el-button>
<slot name="btnBarPrevBtn" />
</template>
<!-- 列表头添加按钮 -->
<template #_action_header v-if="view.btnAddOnColumnHeader">
Expand Down
19 changes: 12 additions & 7 deletions src/component/pro-table/src/ProTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
<h4 class="title">{{ tableTitle }}</h4>
</div>
<!-- table右上角按钮 -->
<div class="btn-bar" v-if="searchMode === 'popover'">
<div class="btn-bar"
:class="{
'btn-bar-absolute': searchMode === 'cover'
}">
<slot name="btnBarPrevBtn" />
</div>
<SearchForm
Expand All @@ -33,12 +36,6 @@
:isLoading="loading"
@clear="fetchHandler(true)"
>
<template v-if="searchMode === 'cover'">
<!-- table右上角按钮 -->
<div class="btn-bar">
<slot name="btnBarPrevBtn" />
</div>
</template>
</SearchForm>
<!-- 表格主体 -->
<el-table v-loading.lock="loading" v-bind="$attrs" v-on="tableListeners" :height="tableHeight" :max-height="maxHeight" ref="tableRefs" :row-key="rowKey" :data="tableData">
Expand Down Expand Up @@ -483,6 +480,14 @@ export default defineComponent({
top: 130px;
left: 10px;
}
.btn-bar-absolute{
float:none !important;
top: 132px;
right: 175px;
width: auto;
position: absolute;
text-align: right;
}
.btn-bar {
float: right;
width: auto;
Expand Down
1 change: 0 additions & 1 deletion src/component/pro-table/src/SearchForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<template v-else>
<!-- 高级查询表单 -->
<SeniorSearchFormCover v-if="showSeniorSearchFormButton" :remoteFuncs="remoteFuncs" @fetchSearch="getFetchParamsSearch" :columns="columns">
<slot></slot>
</SeniorSearchFormCover>
</template>

Expand Down
3 changes: 1 addition & 2 deletions src/component/pro-table/src/SeniorSearchFormCover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
<template>
<div ref="container">
<GenerateForm ref="generateDialogForm" :data="searchFormJson" class="form" :remote="remoteFuncs" :entity.sync="entity" />
<slot></slot>
<div style="float: right">
<el-button size="mini" icon="el-icon-delete" @click="btnRemoveOnClick()">清空</el-button>
<el-button size="mini" type="primary" icon="el-icon-search" @click="getSearchFormData()">查询</el-button>
<el-button size="mini" icon="el-icon-delete" @click="btnRemoveOnClick()">清空</el-button>
<el-tooltip class="item" effect="dark" :content="collpaseButtonText" placement="bottom">
<el-button size="mini" v-if="formDesign.list.length > 2" icon="el-icon-sort" style="float: right; margin-right: 10px" @click="collpase()">更多查询</el-button>
</el-tooltip>
Expand Down

0 comments on commit 805bbff

Please sign in to comment.