CN-71 feat:用户,角色,i18n,操作记录列表页面 添加搜索框
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
@reload="getTableData"
|
||||
@selectionChange="selectionChange"
|
||||
@showBottomBox="(targetTab, object) => { $refs.dataList.showBottomBox(targetTab, object) }"></operation-log-table>
|
||||
@search="search"
|
||||
</template>
|
||||
<!-- 分页组件 -->
|
||||
<template #pagination>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user