表格右侧工具栏组件

This commit is contained in:
RuoYi 2020-08-10 10:12:39 +08:00
parent 60d5c03e65
commit 74f52677be
18 changed files with 57 additions and 57 deletions

View File

@ -66,7 +66,7 @@
v-hasPermi="['${moduleName}:${businessName}:add']"
>新增</el-button>
</el-col>
<table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table

View File

@ -95,7 +95,7 @@
v-hasPermi="['${moduleName}:${businessName}:export']"
>导出</el-button>
</el-col>
<table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange">

View File

@ -1,38 +1,38 @@
<!-- @author Shiyn/ huangmx 20200807优化-->
<template>
<div class="top-right-btn">
<el-row>
<el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="el-icon-search" @click="clickSearch()" />
</el-tooltip>
<el-tooltip class="item" effect="dark" content="刷新" placement="top">
<el-button size="mini" circle icon="el-icon-refresh" @click="clickFresh()" />
</el-tooltip>
</el-row>
</div>
</template>
<script>
export default {
name: "TableToolsExt",
data() {
return {};
},
props: {
showSearch: {
type: Boolean,
default: true,
},
},
methods: {
//
clickSearch() {
this.$emit("update:showSearch", !this.showSearch);
},
//
clickFresh() {
this.$emit("queryTable");
},
},
};
</script>
<!-- @author Shiyn/ huangmx 20200807优化-->
<template>
<div class="top-right-btn">
<el-row>
<el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="el-icon-search" @click="toggleSearch()" />
</el-tooltip>
<el-tooltip class="item" effect="dark" content="刷新" placement="top">
<el-button size="mini" circle icon="el-icon-refresh" @click="refresh()" />
</el-tooltip>
</el-row>
</div>
</template>
<script>
export default {
name: "RightToolbar",
data() {
return {};
},
props: {
showSearch: {
type: Boolean,
default: true,
},
},
methods: {
//
toggleSearch() {
this.$emit("update:showSearch", !this.showSearch);
},
//
refresh() {
this.$emit("queryTable");
},
},
};
</script>

View File

@ -21,7 +21,7 @@ import { getConfigKey } from "@/api/system/config";
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/ruoyi";
import Pagination from "@/components/Pagination";
//自定义表格工具扩展
import TableToolsExt from "@/components/TableToolsExt"
import RightToolbar from "@/components/RightToolbar"
// 全局方法挂载
Vue.prototype.getDicts = getDicts
@ -48,7 +48,7 @@ Vue.prototype.msgInfo = function (msg) {
// 全局组件挂载
Vue.component('Pagination', Pagination)
Vue.component('TableToolsExt', TableToolsExt)
Vue.component('RightToolbar', RightToolbar)
Vue.use(permission)

View File

@ -84,7 +84,7 @@
v-hasPermi="['monitor:job:query']"
>日志</el-button>
</el-col>
<table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="jobList" @selection-change="handleSelectionChange">

View File

@ -90,7 +90,7 @@
v-hasPermi="['monitor:job:export']"
>导出</el-button>
</el-col>
<table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="jobLogList" @selection-change="handleSelectionChange">

View File

@ -84,7 +84,7 @@
v-hasPermi="['system:logininfor:export']"
>导出</el-button>
</el-col>
<table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">

View File

@ -100,7 +100,7 @@
v-hasPermi="['system:config:export']"
>导出</el-button>
</el-col>
<table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">

View File

@ -97,7 +97,7 @@
v-hasPermi="['system:config:remove']"
>清理缓存</el-button>
</el-col>
<table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange">

View File

@ -36,7 +36,7 @@
v-hasPermi="['system:dept:add']"
>新增</el-button>
</el-col>
<table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table

View File

@ -75,7 +75,7 @@
v-hasPermi="['system:dict:export']"
>导出</el-button>
</el-col>
<table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">

View File

@ -103,7 +103,7 @@
v-hasPermi="['system:dict:remove']"
>清理缓存</el-button>
</el-col>
<table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">

View File

@ -36,7 +36,7 @@
v-hasPermi="['system:menu:add']"
>新增</el-button>
</el-col>
<table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table

View File

@ -65,7 +65,7 @@
v-hasPermi="['system:notice:remove']"
>删除</el-button>
</el-col>
<table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange">
@ -164,7 +164,7 @@
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer" style="padding-top:20px">
<div slot="footer" class="dialog-footer" style="padding-top:30px">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>

View File

@ -74,7 +74,7 @@
v-hasPermi="['system:post:export']"
>导出</el-button>
</el-col>
<table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">

View File

@ -94,7 +94,7 @@
v-hasPermi="['system:role:export']"
>导出</el-button>
</el-col>
<table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">

View File

@ -49,7 +49,7 @@
<el-col :span="1.5">
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:user:export']">导出</el-button>
</el-col>
<table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">

View File

@ -76,7 +76,7 @@
v-hasPermi="['tool:gen:remove']"
>删除</el-button>
</el-col>
<table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">