From 98247bb0b4da9a322c97867262c1a76c53ace520 Mon Sep 17 00:00:00 2001
From: web <candymxq888@outlook.com>
Date: 星期三, 26 三月 2025 17:05:18 +0800
Subject: [PATCH] fix: 生态报表

---
 src/views/system/user/index.vue |   39 ++++++++++++++++-----------------------
 1 files changed, 16 insertions(+), 23 deletions(-)

diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index 030dc13..99c400e 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -43,12 +43,12 @@
                 align="center"
               >
                 <template #default="scope">
-                    <div v-if="key.toString() == 'headImg'" style="width: 50px;height: 50px;margin: 0 auto">
-                        <img :src="preUrl + scope.row.headImg" class="table-headImg"/>
+                    <div v-if="key === 'userType'">
+                        {{userTypeList?.filter(fil => fil.dictValue == scope.row.userType.toString())[0].dictLabel}}
                     </div>
                 </template>
             </el-table-column>
-              <el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
+              <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
                 <template #default="scope">
                     <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
                     <el-button v-if="scope.row.userType == 3" link type="primary" icon="Edit" @click="handleRole(scope.row)">绑定角色</el-button>
@@ -67,7 +67,7 @@
           <el-dialog :title="title" v-model="open" append-to-body center>
               <el-form class="form-box"  ref="userRef" :model="form" :rules="rules">
                       <el-form-item label="用户名" prop="userName">
-                          <el-input :disabled ="form.id" v-model="form.userName" placeholder="请输入用户名称"/>
+                          <el-input :disabled ="!!form.id" v-model="form.userName" placeholder="请输入用户名称"/>
                       </el-form-item>
                       <el-form-item v-if="!form.id" label="密码" prop="password">
                           <el-input v-model="form.password" placeholder="请输入密码" />
@@ -94,7 +94,7 @@
                       <el-form-item v-if="!form.id">
                           <br>
                       </el-form-item>
-                        <el-form-item label="上传头像" prop="headImg">
+                        <el-form-item label="上传头像" prop="">
                             <upload-icons @uploadData="uploadData" :imageList="form.headImg" :limit="1"></upload-icons>
                       </el-form-item>
                   <el-form-item></el-form-item>
@@ -131,11 +131,10 @@
     <script setup>
     import  user from "@/api/system/user";
     import  role from "@/api/system/role";
-    import  { PREURL } from "@/config/index";
-    import  userClassify from "@/api/configuration/userClassify";
     import  { sysDictData } from "@/api/system/dict";
-    import setPostParams from "../../../utils/searchParams.js";
+    import setPostParams from "@/utils/searchParams.js";
     const { proxy } = getCurrentInstance();
+    const imgBaseUrl = import.meta.env.VITE_APP_IMG_BASEURL //图片前缀
     
     /**
      * 搜索相关
@@ -154,8 +153,6 @@
     /**
       *  Table表格权限数据列表相关
       */
-
-    let preUrl = ref(PREURL)
     const pageParam = ref({
         total:0,
         limit:0,
@@ -163,14 +160,12 @@
     })
     const tableData = ref([]);
     let  tableHeader = ref({
-            userName: '用户名称',
-            nickName: '昵称',
-            headImg:'头像',
-            userTypeView:'用户类型',
-            // userTypeView:'用户角色',
-            contact:'联系方式',
-            email:'邮箱地址',
-            createTimeView:'创建时间'
+        userName: '用户名称',
+        nickName: '昵称',
+        userType:'用户类型',
+        contact:'联系方式',
+        email:'邮箱地址',
+        createTimeView:'创建时间'
       })
     /** 获取列表 */
     async function getList(val) {
@@ -228,7 +223,6 @@
         password: [{ required: true, message: "请输入密码", trigger: "blur" }],
         nickName: [{ required: true, message: "请输入昵称", trigger: "blur" }],
         userType: [{ required: true, message: "请选择用户类型", trigger: "blur" }],
-        // userRelId: [{ required: true, message: "请选择用户角色", trigger: "blur" }],
         contact: [{ required: true, message: "请输入联系方式", trigger: "blur" }],
         email: [{ required: true, message: "请输入邮箱地址", trigger: "blur" }],
         headImg: [{ required: true, message: "请上传用户头像", trigger: "blur" }],
@@ -238,7 +232,7 @@
 
     //上传文件,添加图片地址信息
     const uploadData = (img) => {
-        form.value.headImg = img.toString()
+        form.value.headImg = imgBaseUrl + img.toString()
     }
 
     //获取用户分类列表
@@ -288,7 +282,6 @@
             nickName: '',
             headImg:undefined,
             userType:undefined,
-            // userRelId:undefined,
             contact:'',
             email:'',
       };
@@ -306,7 +299,7 @@
 
     //获取用户角色列表
     const getUserRole = async() =>{
-      await role().search({limit:1000,page:1}).then((res) =>{
+      await role().search({limit:100,page:1}).then((res) =>{
         roleSelectList.value = res.data.list
         })
     }
@@ -348,7 +341,7 @@
     getUserType()
     getList();
     </script>
-    <style lang="scss">
+    <style lang="scss" scoped>
     .table-headImg{
         max-width: 100px;
         height: 50px;

--
Gitblit v1.9.3