Commit 1158af1b authored by 李苏's avatar 李苏 💬

分页

parent 45eb65cf
......@@ -18,7 +18,7 @@
</el-row>
<!-- 表格-->
<div class="tablePagers">
<TablePager :operateButtons='false' disableQuery @getData='getData' :ref="'TablePager'" :app='app'
<TablePager :operateButtons='false' @getData='getData' :ref="'TablePager'" :app='app'
:query='query' @selectItem='selectItem' @getRow='getRow'>
</TablePager>
</div>
......@@ -52,6 +52,7 @@
/* 查询参数*/
queryParams: {
lx: 'C',
mid:''
},
/* 表格标题对应参数*/
tableTitle: [{
......@@ -126,11 +127,6 @@
fieldType: "ftString",
width: 160
}
]
}
},
......@@ -181,62 +177,14 @@
/*数据处理*/
showTabData(id) {
/* 控制查询loading */
this.$refs.TablePager.loading = true
doQueryDetail({
mid: id
}).then(res => {
if (res.success) {
let records = res.data.records || []
/* 数据处理*/
let gs1 = ''
let gs2 = ''
let lxh1 = records.filter(item => {
if (item.lxh == '1') {
gs1 = item.gsname
return true
}
})
let lxh2 = records.filter(item => {
if (item.lxh == '2') {
gs2 = item.gsname
return true
}
})
/* 根据xh合并*/
let newList = lxh1.map(item1 => {
let newItem = {}
lxh2.forEach(item2 => {
if (item1.xh == item2.xh) {
Object.keys(item2).forEach(key => {
let keyName = key + '2'
newItem[keyName] = item2[key]
})
}
})
/* 最终合并*/
newItem = {
...newItem,
...item1
}
return newItem
})
/* 手动操作表格*/
/* 替换标题*/
// this.$refs.TablePager['newGridList'][1]['label'] = gs1
// this.$refs.TablePager['newGridList'][2]['label'] = gs2
/* 替换数据*/
this.$refs.TablePager['tableData'] = newList
}
}).finally(e => {
this.$refs.TablePager.loading = false
})
this.queryParams.mid=id
this.$refs['TablePager'].reLoad()
},
handleClick(item) {
this.showTabData(item.name)
},
/* 基础查询*/
query: doQuery,
query: doQueryDetail,
apiDelete: doDelete,
queryDetail: doQueryDetail
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment