|
@@ -1,6 +1,6 @@
|
|
|
<script setup>
|
|
|
//ETA图库页面
|
|
|
-import {ref,reactive} from 'vue'
|
|
|
+import {ref,reactive,watch, nextTick} from 'vue'
|
|
|
import { showToast,showDialog} from "vant";
|
|
|
import { useWindowSize } from '@vueuse/core'
|
|
|
import CatalogTree from './components/CatalogTree.vue';
|
|
@@ -252,12 +252,12 @@ const listState = reactive({
|
|
|
})
|
|
|
//获取图表列表
|
|
|
async function getChartList(){
|
|
|
- const {pageSize,cid,page} = listState
|
|
|
+ const {pageSize,cid,page,IsShowMe} = listState
|
|
|
const res = await apiChart.pubChartList({
|
|
|
PageSize: pageSize,
|
|
|
CurrentIndex: page,
|
|
|
ChartClassifyId: cid,
|
|
|
- IsShowMe: false
|
|
|
+ IsShowMe,
|
|
|
})
|
|
|
if(res.Ret!==200) return
|
|
|
const arr = res.Data?res.Data.List:[]
|
|
@@ -267,6 +267,16 @@ async function getChartList(){
|
|
|
listState.loading=false
|
|
|
}
|
|
|
|
|
|
+watch(()=>listState.IsShowMe,()=>{
|
|
|
+ window.scrollTo({top:0})
|
|
|
+ listState.list=[]
|
|
|
+ listState.page=1
|
|
|
+ //设置数据已加载完毕,因为当滚动条不在顶部时,清空列表内容会触发onLoad
|
|
|
+ listState.finished = true
|
|
|
+ //这个函数调用完成后,会把finished重置成正确的值
|
|
|
+ getChartList()
|
|
|
+})
|
|
|
+
|
|
|
//下拉加载
|
|
|
function onLoad(){
|
|
|
if(IsShowCatalog.value) return
|