changesee() {
safety
.See(localStorage.getItem('id'))
.then((res) => {
this.tableData1 = res.data.user;
this.tableData2 = res.data.dept;
this.tableData3 = res.data.grouping;
})
.catch((error) => {
console.log(error);
});
},
在调用接口的时候获取dom元素为table的用ref获取,不太明白你的意思如果只是或去dom元素用ref获取和document.getelementxxx就行(原生js方法也行)
//获取人员数据
getrenyuan() {
safety
.ryuan()
.then((res) => {
this.tableData1 = res.data.userList;
})
.catch((error) => {
console.log(error);
});
},
// 获取群组数据
getqunzu() {
safety
.qunzu()
.then((res) => {
this.tableData3 = res.data.groupList;
})
.catch((error) => {
console.log(error);
});
},
//获取部门数据
getbumen() {
safety
.bumen()
.then((res) => {
this.tableData2 = res.data.list;
console.log(res.data);
})
.catch((error) => {
console.log(error);
});
},
// 查看
changesee() {
safety
.See(localStorage.getItem('id'))
.then((res) => {
this.tableData1 = res.data.user;
this.tableData2 = res.data.dept;
this.tableData3 = res.data.grouping;
})
.catch((error) => {
console.log(error);
});
},