..
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
v-model="tableLoading"
|
||||
:finished="tableFinished"
|
||||
finished-text=""
|
||||
@load="pageData">
|
||||
@load="onLoad">
|
||||
<div class="table-list-container">
|
||||
<div v-for="(row, index) in tableData" :key="index" class="table-list-item">
|
||||
<slot name="header" :index="index" :row="row">
|
||||
@@ -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
|
||||
|
||||
+5
-23
@@ -18,7 +18,7 @@ layout("/layouts/platform_h5.html"){
|
||||
</van-dropdown-menu>
|
||||
</van-sticky>
|
||||
|
||||
<table-list api="/platform/proposal/mine/pageData" :page_form.sync="pageForm" @ready="onReady" ref="tableListRef">
|
||||
<table-list api="/platform/proposal/mine/pageData" :page_form.sync="pageForm" @ready="onReady" ref="tableListRef" title="name">
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="提案类型">{{row.typeName}}</table-column>
|
||||
</template>
|
||||
@@ -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() {
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
+5
-3
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user