报告列表接口对接

This commit is contained in:
yuekuo
2023-04-20 17:34:28 +08:00
parent 02da02008b
commit 327f14fee1
2 changed files with 32 additions and 142 deletions
+14 -56
View File
@@ -109,6 +109,7 @@
default-expand-all
:filter-node-method="filterNode"
ref="tree"
@check="getHalfCheckedNode"
>
</el-tree>
</el-col>
@@ -243,62 +244,8 @@ export default {
content: '',
filterText:'',
treeData: [
{
id: 0,
label: '根节点',
children: [
{
id: 1,
label: '一级 1',
children: [
{
id: 4,
label: '二级 1-1',
children: [
{
id: 9,
label: '三级 1-1-1'
},
{
id: 10,
label: '三级 1-1-2'
}
]
}
]
},
{
id: 2,
label: '一级 2',
children: [
{
id: 5,
label: '二级 2-1'
},
{
id: 6,
label: '二级 2-2'
}
]
},
{
id: 3,
label: '一级 3',
children: [
{
id: 7,
label: '二级 3-1'
},
{
id: 8,
label: '二级 3-2'
}
]
},
]
}
],
checkedKeys:[]
}
},
watch: {
@@ -307,15 +254,26 @@ export default {
}
},
methods: {
getHalfCheckedNode(node,data){
this.checkedKeys=data.checkedKeys
this.reportList()
},
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
init () {
this.getTreeLabel()
this.labelList()
this.reportDateList()
this.reportList()
},
getTreeLabel(){
this.$api.report.labelList().then(res => {
this.treeData=res.data
})
},
// 标签列表
labelList () {
this.$api.report.labelList().then(({ data }) => {
@@ -333,7 +291,7 @@ export default {
},
// 列表
reportList () {
this.$api.report.reportList(this.q).then(({ data }) => {
this.$api.report.reportList({...this.q,labelId:this.checkedKeys}).then(({ data }) => {
this.tableData = data.records
this.total = data.total
this.q.pageNo = data.current