CN-71 feat:用户,角色,i18n,操作记录列表页面 添加搜索框

This commit is contained in:
晶晶 张
2021-07-27 09:19:44 +08:00
parent df61269616
commit 6f5016872d
6 changed files with 24 additions and 15 deletions

View File

@@ -9,9 +9,14 @@
<slot name="top-tool-left"></slot>
</div>
<div class="top-tool-right">
<el-input v-model="keyWord" value="keyWord"></el-input>
<el-button @click="onSearch" icon="el-icon-search" type="info" size="mini" style="margin-right: 10px"></el-button>
<div v-if="showLayout.indexOf('searchInput') > -1" class="top-tool-search margin-r-20"></div>
<div style="margin-right: 10px;display: flex">
<input type="text" v-model="keyWord"/>
<button><i class="el-icon-search" @click="onsearch" ></i></button>
</div>
<!-- <el-input v-model="keyWord" value="keyWord"></el-input>
<el-button @click="onsearch" icon="el-icon-search" type="info" size="mini" style="margin-right: 10px"></el-button>-->
<div v-if="showLayout.indexOf('searchInput') > -1" class="top-tool-search margin-r-20">
</div>
<slot name="top-tool-right"></slot>
<button v-if="showLayout.indexOf('elementSet') > -1" class="top-tool-btn"
type="button" @click="tools.showCustomTableTitle = true">
@@ -45,7 +50,6 @@
<script>
import columnCustomize from '@/components/table/ColumnCustomize'
import { fromRoute } from '@/utils/constants'
import { get } from '@/utils/http'
export default {
name: 'cnDataList',
@@ -78,20 +82,15 @@ export default {
tools: {
showCustomTableTitle: false // 自定义列弹框是否显示
},
showLayout: [],
Search:[],
showLayout: []
}
},
methods: {
updateCustomTableTitle (custom) {
this.$emit('update:customTableTitle', custom)
},
onSearch () {
get('sys/log?pageNo=1&pageSize=30').then(res => {
if(res.code === 200){
this.Search = res.data.list
}
})
onsearch () {
this.$emit('search', this.keyWord)
}
},
watch: {
@@ -106,4 +105,7 @@ export default {
}
</script>
<style>
input:focus{
outline: none;
}
</style>

View File

@@ -17,7 +17,7 @@ export default {
pageObj: { // 分页对象
pageNo: 1,
pageSize: defaultPageSize,
total: 0
total: ''
},
/* 工具参数 */
tools: {
@@ -76,6 +76,7 @@ export default {
}
this.tableData = response.data.list
this.pageObj.total = response.data.total
this.pageObj.total = ''
// TODO 回到顶部
}
})
@@ -143,6 +144,10 @@ export default {
tableDataSort (orderBy) {
this.$set(this.searchLabel, 'orderBy', orderBy)
this.getTableData()
},
search (params) {
this.pageObj.pageNo = 1
this.getTableData({ q: params })
}
},
watch: {

View File

@@ -7,6 +7,7 @@
:api="url"
:from="fromRoute.user"
:layout="['columnCustomize','elementSet']"
@search="search"
>
<template #top-tool-right>
<button
@@ -81,7 +82,6 @@ export default {
}
},
methods: {
}
}
</script>

View File

@@ -23,6 +23,7 @@
@reload="getTableData"
@selectionChange="selectionChange"
@showBottomBox="(targetTab, object) => { $refs.dataList.showBottomBox(targetTab, object) }"></operation-log-table>
@search="search"
</template>
<!-- 分页组件 -->
<template #pagination>

View File

@@ -7,6 +7,7 @@
:api="url"
:from="fromRoute.roles"
:layout="['columnCustomize','elementSet']"
@search="search"
>
<template v-slot:top-tool-right>
<button id="roles-add" v-has="'role_add'" :title="$t('overall.createRole')" class="top-tool-btn margin-r-10"

View File

@@ -7,6 +7,7 @@
:api="url"
:from="fromRoute.user"
:layout="['columnCustomize','elementSet']"
@search="search"
>
<template #top-tool-right>
<button
@@ -85,7 +86,6 @@ export default {
}
},
methods: {
}
}
</script>