| | |
| | | import userInfo from "./userInfo"; |
| | | import resetPwd from "./resetPwd"; |
| | | import { getUserProfile ,getSelfPermission} from "@/api/system/user"; |
| | | import {updateFamilyevent} from "@/api/bignote"; |
| | | |
| | | export default { |
| | | name: "Profile", |
| | | components: { userAvatar, userInfo, resetPwd }, |
| | | data() { |
| | | return { |
| | | data: { |
| | | formDat: { |
| | | familyName: undefined, |
| | | modelName: undefined, |
| | | }, |
| | | selectedFamily: '', // 初始化选中的家庭为空字符串 |
| | | SelfPermission:undefined, |
| | | SelfPermissionList:[], |
| | | user: {}, |
| | | roleGroup: {}, |
| | | postGroup: {}, |
| | | activeTab: "userinfo", |
| | | activeTab1:"ueserinfopermission" |
| | | activeTab1:"家根网" |
| | | }; |
| | | }, |
| | | |
| | | created() { |
| | | this.getUser(); |
| | | this.getUserPermission(); |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | handleTabClick(tab) { |
| | | this.selectedTab = tab.label; |
| | | if (this.selectedFamily && this.selectedTab) { |
| | | this.getUserPermission(); // 调用 getList 方法 |
| | | this.getList(); |
| | | } |
| | | }, |
| | | handleDropdownCommand(command) { |
| | | |
| | | this.selectedFamily = command; // 更新选中的家庭 |
| | | console.log(this.selectedFamily) |
| | | // 检查下拉菜单和切片页面是否都被选中 |
| | | if (this.selectedFamily && this.selectedTab) { |
| | | this.getUserPermission(); // 调用 getList 方法 |
| | | this.getList(); |
| | | } |
| | | }, |
| | | |
| | |
| | | this.postGroup = response.postGroup; |
| | | }); |
| | | }, |
| | | getUserPermission(){ |
| | | console.log(this.selectedTab) |
| | | console.log(this.selectedFamily) |
| | | this.data = ({ |
| | | familyName: this.selectedFamily, |
| | | modelName: this.selectedTab |
| | | getList() { |
| | | var formData = { |
| | | "familyName": "一号家庭", |
| | | "modelName": "家根网" |
| | | }; |
| | | |
| | | var jsonString = JSON.stringify(formData); |
| | | console.log(jsonString); |
| | | |
| | | getSelfPermission(jsonString).then(response => { |
| | | this.SelfPermissionList = response.data; |
| | | console.log(this.SelfPermissionList) |
| | | }); |
| | | console.log(this.data) |
| | | console.log(typeof this.data) |
| | | const jsonData = JSON.stringify(this.data); // 将对象转换为 JSON 字符串 |
| | | console.log(jsonData); // 打印 JSON 字符串 |
| | | // debugger |
| | | if(jsonData){ |
| | | getSelfPermission(jsonData).then(response => { |
| | | this.SelfPermission = response.data; |
| | | console.log(111); |
| | | console.log(this.SelfPermission); |
| | | }) |
| | | .catch(error => { |
| | | // 处理错误 |
| | | }); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | }; |
| | | </script> |
| | | <style> |