| | |
| | | </div> |
| | | </div> |
| | | <review-dialog ref="reviewRef" ></review-dialog> |
| | | <register ref="regRef" @getList="getList" /> |
| | | <supervise-dialog ref="superRef"></supervise-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ElMessageBox } from 'element-plus' |
| | | import {ElMessage, ElMessageBox} from 'element-plus' |
| | | import Breadcrumb from '@/components/Breadcrumb' |
| | | import TopNav from '@/components/TopNav' |
| | | import Hamburger from '@/components/Hamburger' |
| | |
| | | import Cookies from "js-cookie"; |
| | | import reviewDialog from "@/views/safetyReview/institution/components/viewInstitution.vue" |
| | | import superviseDialog from "@/views/safetyReview/userManage/superviseUsers/components/superviseDialog.vue" |
| | | import {Register} from "@/layout/components"; |
| | | import {getUserById} from "@/api/sysUsers"; |
| | | import menu from "@/layout/components/Sidebar/menu"; |
| | | |
| | | const appStore = useAppStore() |
| | | const userStore = useUserStore() |
| | | const settingsStore = useSettingsStore() |
| | | |
| | | const reviewRef = ref(); |
| | | const regRef = ref(null) |
| | | const superRef = ref(); |
| | | const userInfo = ref(); |
| | | onMounted(()=>{ |
| | | if(getToken()){ |
| | | userInfo.value = JSON.parse(Cookies.get('userInfo')) |
| | | console.log("userInfo",userInfo.value ) |
| | | |
| | | } |
| | | getState(); |
| | | }) |
| | | const getState = async () => { |
| | | console.log('navbar') |
| | | const param = { |
| | | userId: userInfo.value.id |
| | | } |
| | | const res = await getUserById(param) |
| | | if(res.code == 200){ |
| | | userInfo.value.state = res.data.state; |
| | | // if(userInfo.value.state===2){ |
| | | // sidebarRouters.value = menu.agencyMenu |
| | | // Cookies.set('routers',JSON.stringify(sidebarRouters.value)) |
| | | // location.href = '/project'; |
| | | // } |
| | | // else { |
| | | // location.href = '/noMenu'; |
| | | // } |
| | | |
| | | |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.message |
| | | }) |
| | | } |
| | | } |
| | | function toggleSideBar() { |
| | | appStore.toggleSideBar() |
| | | } |
| | |
| | | } |
| | | |
| | | function getInfo() { |
| | | console.log("getInfo") |
| | | console.log("getInfo",userInfo.value) |
| | | //机构用户 |
| | | if(userInfo.value.identity === 1){ |
| | | const obj = { |
| | | agencyId: userInfo.value.agentId |
| | | //审核驳回(可修改) |
| | | if(userInfo.value.state === 3){ |
| | | const obj = { |
| | | id: userInfo.value.id, |
| | | username: userInfo.value.username, |
| | | agencyId: userInfo.value.agentId |
| | | } |
| | | regRef.value.openDialog('reject', obj); |
| | | }else{ |
| | | //审核通过、未审核状态(不可修改) |
| | | const obj = { |
| | | agencyId: userInfo.value.agentId |
| | | } |
| | | reviewRef.value.openDialog(obj,'view') |
| | | } |
| | | reviewRef.value.openDialog(obj,'view') |
| | | } |
| | | //监管用户 |
| | | else if (userInfo.value.identity === 0) { |
| | |
| | | function editPsd() { |
| | | superRef.value.openDialog('pwd', userInfo.value); |
| | | } |
| | | const sidebarRouters = ref([]) |
| | | |
| | | const getList = () => { |
| | | // getState() |
| | | location.href = '/noMenu'; |
| | | // if(userInfo.value.state===2){ |
| | | // sidebarRouters.value = menu.agencyMenu |
| | | // Cookies.set('routers',JSON.stringify(sidebarRouters.value)) |
| | | // location.href = '/project'; |
| | | // }else { |
| | | // location.href = '/noMenu'; |
| | | // } |
| | | } |
| | | |
| | | function logout() { |
| | | ElMessageBox.confirm('确定注销并退出系统吗?', '提示', { |