桌台增加分页
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
<input v-model="search.keyword" @confirm="searchConfirm" type="text"
|
<input v-model="search.keyword" @confirm="searchConfirm" type="text"
|
||||||
placeholder-style="font-size:28rpx;" placeholder="搜索" />
|
placeholder-style="font-size:28rpx;" placeholder="搜索" />
|
||||||
</view>
|
</view>
|
||||||
<view @tap.stop="hideSearch" v-if="search.show">取消</view>
|
<view @tap.stop="clearSearch" v-if="search.show">取消</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view :style="{height:times.show?timesHeight:0}" class="tranistion status overflow-hide">
|
<view :style="{height:times.show?timesHeight:0}" class="tranistion status overflow-hide">
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<view :style="{height: status.bottomHeight+'px'}"></view>
|
<view :style="{height: status.bottomHeight+'px'}"></view>
|
||||||
</view>
|
</view>
|
||||||
<view :style="{height:status.show?statusHeight:0}" class="tranistion status overflow-hide">
|
<view :style="{height:status.show?statusHeight:0}" class="tranistion status overflow-hide">
|
||||||
<view @tap="changestatusActive(index)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
|
<view @tap="changestatusActive(index,item)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
|
||||||
v-for="(item,index) in status.list" :key="index">
|
v-for="(item,index) in status.list" :key="index">
|
||||||
<view>{{item.label}}</view>
|
<view>{{item.label}}</view>
|
||||||
<uni-icons v-if="status.active===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
|
<uni-icons v-if="status.active===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
|
||||||
@@ -246,12 +246,16 @@
|
|||||||
|
|
||||||
function searchConfirm() {
|
function searchConfirm() {
|
||||||
hideSearch()
|
hideSearch()
|
||||||
filterTableList()
|
query.page=1;
|
||||||
|
getTable()
|
||||||
// tables.list = tables.originList.filter((v) =>
|
// tables.list = tables.originList.filter((v) =>
|
||||||
// v.name.includes(search.keyword.trim())
|
// v.name.includes(search.keyword.trim())
|
||||||
// );
|
// );
|
||||||
}
|
}
|
||||||
|
function clearSearch(){
|
||||||
|
search.keyword=''
|
||||||
|
hideSearch()
|
||||||
|
}
|
||||||
function hideSearch() {
|
function hideSearch() {
|
||||||
search.show = false
|
search.show = false
|
||||||
maskHide()
|
maskHide()
|
||||||
@@ -406,13 +410,14 @@
|
|||||||
query.areaId = item.id
|
query.areaId = item.id
|
||||||
}
|
}
|
||||||
async function getTable() {
|
async function getTable() {
|
||||||
|
let state=status.list[status.active].key
|
||||||
|
state=state?(state=='all'?'':state):''
|
||||||
const {
|
const {
|
||||||
content,total
|
content,total
|
||||||
} = await $table.get(query)
|
} = await $table.get({...query,name:search.keyword,state})
|
||||||
tables.hasAjax = true
|
tables.hasAjax = true
|
||||||
query.totalElements=total||0
|
query.totalElements=total||0
|
||||||
tables.originList = content
|
tables.list = content
|
||||||
filterTableList()
|
|
||||||
}
|
}
|
||||||
const areaMap = ref({})
|
const areaMap = ref({})
|
||||||
async function getArea() {
|
async function getArea() {
|
||||||
@@ -441,17 +446,8 @@
|
|||||||
// tables.list = tables.originList.filter((v) => {
|
// tables.list = tables.originList.filter((v) => {
|
||||||
// return v.status == status.list[status.active].key
|
// return v.status == status.list[status.active].key
|
||||||
// });
|
// });
|
||||||
filterTableList()
|
getTable()
|
||||||
})
|
})
|
||||||
|
|
||||||
function filterTableList() {
|
|
||||||
tables.list = tables.originList.filter((v) => {
|
|
||||||
console.log(status.list[status.active].key);
|
|
||||||
return (status.active == 0 ? true : v.status == status.list[status.active].key) && (
|
|
||||||
v.name.includes(search.keyword.trim())
|
|
||||||
)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
watch(() => times.active, (newval) => {
|
watch(() => times.active, (newval) => {
|
||||||
setTimer()
|
setTimer()
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user