From b8a1db82421cb4faff2e5bb51ddaab0f6d67e37e Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期二, 27 八月 2024 14:28:51 +0800
Subject: [PATCH] 提交

---
 src/layout/components/Navbar.vue           |    4 +++-
 src/views/onlineEducation/people/index.vue |    7 +++++--
 src/views/components/upload.vue            |    1 -
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 3c87756..e04cd9a 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -27,7 +27,7 @@
           <div class="avatar-wrapper" style="display: flex;align-items: center">
 <!--            <img :src="userStore.avatar" class="user-avatar" />-->
             <img src="../../assets/images/avator.png" class="user-avatar"  />
-            <span>{{userName}}</span>
+            <span style="font-size: 16px">{{userName}}({{userTypeName}})</span>
             <el-icon><caret-bottom /></el-icon>
           </div>
           <template #dropdown>
@@ -85,10 +85,12 @@
 const superRef = ref();
 const userInfo = ref();
 const userName = ref('')
+const userTypeName = ref('')
 onMounted(()=>{
   if(getToken()){
     userInfo.value = JSON.parse(Cookies.get('userInfo'))
     userName.value = userInfo.value.username
+    userTypeName.value = userInfo.value.userType == 0 ? '管理员' : userInfo.value.userType == 1 ? '企业级' :userInfo.value.userType == 2 ? '部门级':userInfo.value.userType == 3 ? '车间级' :userInfo.value.userType == 4 ? '其他' : '学员'
     console.log("userInfo",userInfo.value )
   }
   // getState();
diff --git a/src/views/components/upload.vue b/src/views/components/upload.vue
index 481cda0..ca523be 100644
--- a/src/views/components/upload.vue
+++ b/src/views/components/upload.vue
@@ -455,7 +455,6 @@
     if(filetype == 'mp4' || filetype == 'MP4'){
       container.showVideo = true
       await nextTick(() => {
-
         console.log("myPlayer.value",myPlayer.value)
         myPlayer.value.src(
             {
diff --git a/src/views/onlineEducation/people/index.vue b/src/views/onlineEducation/people/index.vue
index 93459d9..2fa825f 100644
--- a/src/views/onlineEducation/people/index.vue
+++ b/src/views/onlineEducation/people/index.vue
@@ -100,10 +100,11 @@
 });
 
 const { queryParams, total, dataList } = toRefs(data);
-
+const userType = ref()
 onMounted(async ()=>{
   const userInfo = JSON.parse(Cookies.get('userInfo'))
   console.log("userInfo",userInfo)
+  userType.value = userInfo.userType
   if(userInfo.userType === 0){
     data.isAdmin = true;
   }else {
@@ -130,7 +131,9 @@
 const openDialog = (type, value) => {
   if(type == 'add' && data.isAdmin){
     ElMessage.warning('监管部门请联系企业创建企业学员')
-  }else{
+  }else if(userType.value !== 3 && (type == 'add' || type == 'edit')) {
+    ElMessage.warning(' 只有车间级用户才能新增和编辑')
+  } else{
     dialogRef.value.openDialog(type, value);
   }
 

--
Gitblit v1.9.2