diff --git a/src/main/resources/static/components/plugins/h5/TableList.vue b/src/main/resources/static/components/plugins/h5/TableList.vue index 25560adc..f371adde 100644 --- a/src/main/resources/static/components/plugins/h5/TableList.vue +++ b/src/main/resources/static/components/plugins/h5/TableList.vue @@ -7,7 +7,7 @@ v-model="tableLoading" :finished="tableFinished" finished-text="" - @load="pageData"> + @load="onLoad">
@@ -59,11 +59,12 @@ module.exports = { }, watch: { page_form: { - handler(val) { - this.localPageForm = {...val} + handler(newVal, oldVal) { + debugger + this.localPageForm = {...newVal} }, deep: true, - immediate: false + immediate: true } }, data() { @@ -76,9 +77,16 @@ module.exports = { } }, methods: { + onLoad(){ + if (this.tableFinished) return + this.localPageForm.pageNumber++ + this.$emit('update:page_form', {...this.localPageForm}); + this.pageData() + }, + pageData() { this.tableLoading = true - // this.localPageForm = {...this.page_form} + const loading = createListLoading() this.$axios.post(this.api, this.json ? ({pageForm: JSON.stringify(this.localPageForm)}) : this.localPageForm).then((res) => { if (res.code === 0) { @@ -87,20 +95,21 @@ module.exports = { if (this.tableData.length >= this.localPageForm.totalCount) { this.tableFinished = true } - this.localPageForm.pageNumber++ - // 触发事件更新父组件的pageForm - this.$emit('update:page_form', {...this.localPageForm}); } }).finally(() => { loading.close() + console.log(this.tableLoading) this.tableLoading = false + console.log(this.tableLoading) this.tableRefreshing = false }) }, doSearch() { - this.tableFinished = false; - this.tableData = []; - this.pageData(); + this.tableFinished = false + this.tableData = [] + this.localPageForm.pageNumber = 1 + this.$emit('update:page_form', {...this.localPageForm}); + this.pageData() }, onRefresh() { this.localPageForm.pageNumber = 1 diff --git a/src/main/resources/views/platform/zhghh5/democratic/proposal/transact/mine/index.html b/src/main/resources/views/platform/zhghh5/democratic/proposal/transact/mine/index.html index d4c6465f..3662af3e 100644 --- a/src/main/resources/views/platform/zhghh5/democratic/proposal/transact/mine/index.html +++ b/src/main/resources/views/platform/zhghh5/democratic/proposal/transact/mine/index.html @@ -18,7 +18,7 @@ layout("/layouts/platform_h5.html"){ - + @@ -78,7 +78,7 @@ layout("/layouts/platform_h5.html"){ .concat([{text: "全部届次", value: null}]) if (this.sessionOptions.length > 0) { this.pageForm.sessionId = this.sessionOptions[0].value - this.pageData() + this.doSearch() } } }) @@ -96,27 +96,10 @@ layout("/layouts/platform_h5.html"){ pageData() { this.$refs.tableListRef.pageData() - // this.tableLoading = true - // const loading = createListLoading() - // this.$axios - // .post("/platform/proposal/mine/pageData", this.pageForm) - // .then((res) => { - // if (res.code === 0) { - // this.tableData = this.tableData.concat(res.data.list) - // this.pageForm.totalCount = res.data.totalCount - // if (this.tableData.length >= this.pageForm.totalCount) { - // this.tableFinished = true - // } - // this.pageForm.pageNumber++ - // } - // }) - // .finally(() => { - // loading.close() - // this.tableLoading = false - // this.tableRefreshing = false - // }) }, doSearch() { + this.pageForm.pageNumber = 1 + this.pageForm.totalCount = 0 this.$refs.tableListRef.doSearch() }, openRevoke(row) { @@ -148,10 +131,9 @@ layout("/layouts/platform_h5.html"){ }) }, onReady() { + debugger this.listSession() } - }, - created() { } }) diff --git a/src/main/resources/views/platform/zhghh5/democratic/teachercongress/delegate/read/index.html b/src/main/resources/views/platform/zhghh5/democratic/teachercongress/delegate/read/index.html index 8f5a24d6..064c911a 100644 --- a/src/main/resources/views/platform/zhghh5/democratic/teachercongress/delegate/read/index.html +++ b/src/main/resources/views/platform/zhghh5/democratic/teachercongress/delegate/read/index.html @@ -137,9 +137,11 @@ layout("/layouts/platform_h5.html"){ }) }, doSearch() { - this.pageForm.pageNumber = 1 - this.pageForm.totalCount = 0 - this.$refs.tableListRef.doSearch() + this.$nextTick(() => { + this.pageForm.pageNumber = 1 + this.pageForm.totalCount = 0 + this.$refs.tableListRef.doSearch() + }) }, onReady() { this.listRole()