|
|
@@ -19,11 +19,10 @@
|
|
|
<slot name="customOperation"></slot>
|
|
|
</div>
|
|
|
<el-button v-if="tool.checkAuth($route.name,'delete') && delApiId" :type="checkDisabled()?'':'primary'" class="inline-16" size="mini" :disabled="checkDisabled()" @click="deleteData">删 除</el-button>
|
|
|
-
|
|
|
-<!-- <div v-if="!pageChange">
|
|
|
+ <div>
|
|
|
<el-button size="mini" icon="el-icon-arrow-left" @click="previous()"></el-button>
|
|
|
<el-button size="mini" @click="next()"><i class="el-icon-arrow-right"></i></el-button>
|
|
|
- </div>-->
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div>
|
|
|
@@ -104,7 +103,6 @@ export default {
|
|
|
refreshPage:true,
|
|
|
reportCenterLsit:[],
|
|
|
systemappid:JSON.parse(sessionStorage.getItem('activeApp')).systemappid,
|
|
|
- idx:0
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
|
@@ -149,17 +147,21 @@ export default {
|
|
|
reportCenter
|
|
|
},
|
|
|
methods:{
|
|
|
- async queryData (pageNumber) {
|
|
|
- /* 暴露请求配置 进行修改 */
|
|
|
- this.$emit('updateParam',this.param)
|
|
|
-
|
|
|
- this.param.id = this.turnPageId
|
|
|
- this.param.content.pageNumber = pageNumber
|
|
|
- const res = await this.$api.requested(this.param)
|
|
|
- this.total = res.total
|
|
|
- // this.$emit('pageChange',res.data[0][this.idname],res.data[0].rowindex)
|
|
|
- this.$refs['tag']?this.$refs['tag'].queryTag():''
|
|
|
- this.refresh()
|
|
|
+ // async queryData (pageNumber) {
|
|
|
+ // this.$emit('updateParam',this.param)
|
|
|
+ // this.param.id = this.turnPageId
|
|
|
+ // this.param.content.pageNumber = pageNumber
|
|
|
+ // const res = await this.$api.requested(this.param)
|
|
|
+ // this.total = res.total
|
|
|
+ // this.$refs['tag']?this.$refs['tag'].queryTag():''
|
|
|
+ // this.refresh()
|
|
|
+ // },
|
|
|
+ async nextData(param,fn) {
|
|
|
+ console.log('执行')
|
|
|
+ this.rowStatus = null
|
|
|
+ const res = await this.$api.requested(param)
|
|
|
+ this.$store.dispatch('saveListData',{listData:res.data,param:param,pageTotal:res.pageTotal})
|
|
|
+ fn?fn():''
|
|
|
},
|
|
|
/* 获取是否有报表数据 */
|
|
|
async getSystemAppid () {
|
|
|
@@ -185,40 +187,61 @@ export default {
|
|
|
window.open(this.tool.getBaseUrl() + res.data + `&${this.idname}=${data}`)
|
|
|
})
|
|
|
},
|
|
|
- next () {
|
|
|
- let nowId = this.$route.query.id
|
|
|
- let changeId = ''
|
|
|
- console.log( this.svlistData.listData)
|
|
|
- if ((this.idx + 1) == this.svlistData.listData.length) return this.$message({
|
|
|
- message:"已经是当前页最后一条了!",
|
|
|
- type:'warning'
|
|
|
- })
|
|
|
- this.svlistData.listData.forEach((e,index)=>{
|
|
|
- if (e[this.idname] == nowId) {
|
|
|
- changeId = this.svlistData.listData[index + 1][this.idname]
|
|
|
- this.idx = index + 1
|
|
|
+ async next () {
|
|
|
+ const rs = await this.checkPaginationData()
|
|
|
+ if (rs == 0 && this.svlistData.listData.length == 1) return false
|
|
|
+ if (rs == 1 && this.svlistData.param.content.pageNumber == this.svlistData.pageTotal) return false
|
|
|
+ let fun = (rs) =>{
|
|
|
+ let nowId = this.$route.query.id
|
|
|
+ let changeId = ''
|
|
|
+ if (rs == 1) {
|
|
|
+ changeId = this.svlistData.listData[0][this.idname]
|
|
|
+ } else {
|
|
|
+ this.svlistData.listData.forEach((e,index)=>{
|
|
|
+ if (e[this.idname] == nowId) {
|
|
|
+ changeId = this.svlistData.listData[index + 1][this.idname]
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- })
|
|
|
-
|
|
|
- this.$emit('pageChange',changeId,this.idx)
|
|
|
- this.refresh()
|
|
|
+ this.$emit('pageChange',changeId,this.idx)
|
|
|
+ this.refresh()
|
|
|
+ }
|
|
|
+ if (rs == 1) {
|
|
|
+ this.svlistData.param.content.pageNumber ++
|
|
|
+ this.nextData(this.svlistData.param,(rs)=>{
|
|
|
+ fun(1)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ fun()
|
|
|
+ }
|
|
|
},
|
|
|
- previous () {
|
|
|
- let nowId = this.$route.query.id
|
|
|
- let changeId = ''
|
|
|
- if ((this.idx - 1) < 0) return this.$message({
|
|
|
- message:"当前是第一条",
|
|
|
- type:'warning'
|
|
|
- })
|
|
|
- this.svlistData.listData.forEach((e,index)=>{
|
|
|
- if (e[this.idname] == nowId) {
|
|
|
- changeId = this.svlistData.listData[index - 1][this.idname]
|
|
|
- this.idx = index - 1
|
|
|
+ async previous () {
|
|
|
+ const res = await this.checkPaginationData()
|
|
|
+ if (res == 0 && this.svlistData.param.content.pageNumber == 1) return false
|
|
|
+ const fun = (rs)=>{
|
|
|
+ let nowId = this.$route.query.id
|
|
|
+ let changeId = ''
|
|
|
+
|
|
|
+ if (rs == 0) {
|
|
|
+ changeId = this.svlistData.listData[this.svlistData.listData.length - 1][this.idname]
|
|
|
+ } else {
|
|
|
+ this.svlistData.listData.forEach((e,index)=>{
|
|
|
+ if (e[this.idname] == nowId) {
|
|
|
+ changeId = this.svlistData.listData[index - 1][this.idname]
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- })
|
|
|
-
|
|
|
- this.$emit('pageChange',changeId,this.idx)
|
|
|
- this.refresh()
|
|
|
+ this.$emit('pageChange',changeId,this.idx)
|
|
|
+ this.refresh()
|
|
|
+ }
|
|
|
+ if (res == 0) {
|
|
|
+ this.svlistData.param.content.pageNumber --
|
|
|
+ this.nextData(this.svlistData.param,()=>{
|
|
|
+ fun(0)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ fun()
|
|
|
+ }
|
|
|
},
|
|
|
onSuccess () {
|
|
|
this.$emit('onEditSuccess')
|
|
|
@@ -283,10 +306,33 @@ export default {
|
|
|
},
|
|
|
closeTags() {
|
|
|
this.$refs.tag?this.$refs.tag.closeTag():''
|
|
|
+ },
|
|
|
+
|
|
|
+ checkPaginationData () {
|
|
|
+ return new Promise((reslove,reject)=>{
|
|
|
+ let id = this.$route.query.id
|
|
|
+ let n = 0
|
|
|
+ console.log(this.svlistData.listData)
|
|
|
+ this.svlistData.listData.filter((e,index)=>{
|
|
|
+ if (e[this.idname] == id){
|
|
|
+
|
|
|
+ n = index
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (n == 0) {
|
|
|
+ reslove(0)
|
|
|
+ } else if (n == this.svlistData.listData.length - 1) {
|
|
|
+ reslove(1)
|
|
|
+ } else {
|
|
|
+ reslove(-1)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
+ // this.checkPaginationData()
|
|
|
this.idx = this.$route.query.rowindex
|
|
|
+
|
|
|
},
|
|
|
created () {
|
|
|
this.$emit('detailCreate',this.param)
|
|
|
@@ -297,6 +343,7 @@ export default {
|
|
|
watch:{
|
|
|
mainAreaData () {
|
|
|
// console.log(this.mainAData,'mainAData')
|
|
|
+ // this.checkPaginationData()
|
|
|
}
|
|
|
}
|
|
|
}
|