我的浏览模糊查询

This commit is contained in:
851673013@qq.com 2022-07-19 11:14:46 +08:00
parent a52966d68a
commit 4b33b089f1
1 changed files with 41 additions and 2 deletions

View File

@ -141,7 +141,7 @@
</div>
</template>
<script setup>
import { onMounted, ref } from 'vue'
import { onMounted, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import { message } from 'ant-design-vue'
import { updateVisits, browsingInsert } from '@/api/home'
@ -218,6 +218,7 @@
type.value = ''
pageNum.value = '1'
pageSize.value = '5'
tabIndex.value = 0
showKey.value++
checkAll.value = false
getList()
@ -229,6 +230,8 @@
getBsList({
limit: pageSize.value,
page: pageNum.value,
type: tabList.value[tabIndex.value],
name: name.value,
}).then((res) => {
checkAll.value = true
console.log('申购车列表================>', res)
@ -328,7 +331,7 @@
showKey.value++
}
//
const tabIndex = ref(-1)
const tabIndex = ref(0)
const changeTab = (index) => {
console.log('tabIndex', tabIndex.value, index, tabList)
if (tabIndex.value == index) {
@ -381,6 +384,42 @@
}
}
}
//tabindex
watch(tabIndex, (val) => {
getBsList({
limit: pageSize.value,
page: pageNum.value,
type: tabList.value[val],
name: name.value,
}).then((res) => {
checkAll.value = true
console.log('申购车列表================>', res)
initLoading.value = false
list.value = []
total.value = res.data.data.total
res.data.data.list.forEach((val) => {
const obj = {
loading: false,
name: val.resourceDTO.name,
id: val.id,
checked: false,
visits: val.resourceDTO.visits,
type: val.resourceDTO.type,
link: val.resourceDTO.link,
resourceId: val.resourceId,
createDate: val.createDate,
description: val.resourceDTO.description,
delFlag: val.resourceDTO.delFlag,
}
if (checkedList.value.indexOf(val.id) == -1) {
checkAll.value = false
} else {
obj.checked = true
}
list.value.push(obj)
})
})
})
</script>
<style lang="less" scoped>
.ant-list {