This commit is contained in:
liuye
2023-09-06 13:36:05 +08:00
parent 27be7e63fc
commit f05e036bd0

View File

@@ -5,7 +5,7 @@
<template #rightBtn> <template #rightBtn>
<el-row type="flex" align="middle"> <el-row type="flex" align="middle">
<el-cascader ref="cascader1" clearable v-model="totalDeptList" :options="deptOptions" placeholder="所属部门" size="small" <el-cascader ref="cascader1" clearable v-model="totalDeptList" :options="deptOptions" placeholder="所属部门" size="small"
:props="defaultProps" :show-all-levels="false" @change="totalDeptSelect"></el-cascader> :props="defaultProps" :show-all-levels="false" @visible-change="totalDeptSelect"></el-cascader>
</el-row> </el-row>
</template> </template>
</ai-title> </ai-title>
@@ -150,7 +150,7 @@ export default {
methods: { methods: {
getStatisticsToatl() { getStatisticsToatl() {
console.log(1) console.log(1)
var totalDepartmentId = this.totalDeptList && this.totalDeptList.length ? this.totalDeptList[0] : '' var totalDepartmentId = this.totalDeptList.length ? this.totalDeptList[this.totalDeptList.length-1] : ''
this.instance.post(`/app/appsessionarchivekeywordrecord/statistics1?departmentId=${totalDepartmentId}`).then(res => { this.instance.post(`/app/appsessionarchivekeywordrecord/statistics1?departmentId=${totalDepartmentId}`).then(res => {
if (res?.data) { if (res?.data) {
console.log(res) console.log(res)
@@ -345,7 +345,7 @@ export default {
map[item.id] = item; map[item.id] = item;
}); });
data.forEach(item => { data.forEach(item => {
let parent = map[item.parentGirdId]; let parent = map[item.parentid];
if (parent) { if (parent) {
(parent.children || (parent.children = [])).push(item); (parent.children || (parent.children = [])).push(item);
} else { } else {
@@ -355,10 +355,9 @@ export default {
return result; return result;
}, },
totalDeptSelect(val) { totalDeptSelect(val) {
console.log(123) if(!val) {
this.totalDeptList = val this.getStatisticsToatl()
this.$refs.cascader1.dropDownVisible = false; }
this.getStatisticsToatl()
}, },
deptSelect(val) { deptSelect(val) {
this.deptList = val this.deptList = val