浏览代码

用户管理

chenying2100 2 月之前
父节点
当前提交
f1cb8c87bd

+ 431 - 0
.specstory/history/2025-06-24_02-08-调整表单label宽度以完全显示.md

@@ -0,0 +1,431 @@
+<!-- Generated by SpecStory -->
+
+# 调整表单label宽度以完全显示 (2025-06-24 10:08:34)
+
+_**User**_
+
+帮我调整这个label的宽度,可以完全显示
+
+---
+
+_**Assistant**_
+
+你想要调整`src/views/system/role/index.vue`中表单项(label)的宽度,使其可以完全显示。你可以通过设置`el-form`的`label-width`属性来实现。例如:
+
+```vue
+<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="100px">
+```
+
+你可以根据实际内容调整`label-width`的数值,比如`120px`、`150px`等,直到所有label都能完整显示。
+
+我将帮你把顶部搜索表单的`el-form`加上`label-width="120px"`,这样所有label都能完整显示。你可以根据实际效果再微调。
+
+---
+
+Read file: src/views/system/role/index.vue
+
+---
+
+```diff
+        <div v-show="showSearch" class="mb-[10px]">
+          <el-card shadow="hover">
+-           <el-form ref="queryFormRef" :model="queryParams" :inline="true">           
++           <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="120px">           
+              <el-form-item label="角色编码" prop="roleKey">
+                <el-input v-model="queryParams.roleKey" placeholder="请输入角色编码" clearable @keyup.enter="handleQuery" />
+```
+
+---
+
+我已将顶部搜索表单的`el-form`添加了`label-width="120px"`,现在所有label都能完整显示。你可以根据实际显示效果继续调整这个数值,比如`130px`、`140px`等。如果还有其他表单需要调整,也可以用同样的方法。需要进一步美化或有其他需求随时告诉我!
+
+---
+
+_**User**_
+
+帮我生成数据库表中的字段
+
+---
+
+_**Assistant**_
+
+根据你提供的信息(info.txt),我为你整理了适合数据库表(如用户表 user)的字段名及类型建议。你可以根据实际业务需求调整类型长度或细节。
+
+### 建议的数据库表字段(MySQL为例)
+
+| 字段名         | 类型             | 说明         |
+|----------------|------------------|--------------|
+| id             | BIGINT PRIMARY KEY AUTO_INCREMENT | 主键,自增 |
+| name           | VARCHAR(50)      | 姓名         |
+| password       | VARCHAR(100)     | 密码(加密存储)|
+| alias          | VARCHAR(50)      | 别名         |
+| role           | VARCHAR(50)      | 角色         |
+| gender         | CHAR(1)          | 性别(M/F)  |
+| department     | VARCHAR(100)     | 所属科室     |
+| username       | VARCHAR(50)      | 登录名       |
+| dept_code      | VARCHAR(50)      | 所属科室编码 |
+| job_number     | VARCHAR(50)      | 工号         |
+| id_card        | VARCHAR(18)      | 身份证号码   |
+| address        | VARCHAR(200)     | 现住地址     |
+| birth_date     | DATE             | 出生日期     |
+| reg_address    | VARCHAR(200)     | 户籍地址     |
+| nation         | VARCHAR(20)      | 民族         |
+| political      | VARCHAR(20)      | 政治面貌     |
+| marital        | VARCHAR(10)      | 婚姻状况     |
+| title          | VARCHAR(50)      | 职称         |
+| education      | VARCHAR(20)      | 学历         |
+| phone          | VARCHAR(20)      | 手机号码     |
+| email          | VARCHAR(100)     | 电子邮箱     |
+| intro          | TEXT             | 职工简介     |
+| expertise      | VARCHAR(200)     | 擅长疾病     |
+| signature_img  | VARCHAR(200)     | 签名图片路径 |
+
+### 示例建表SQL
+
+```sql
+CREATE TABLE user (
+    id BIGINT PRIMARY KEY AUTO_INCREMENT,
+    name VARCHAR(50) NOT NULL,
+    password VARCHAR(100) NOT NULL,
+    alias VARCHAR(50),
+    role VARCHAR(50),
+    gender CHAR(1),
+    department VARCHAR(100),
+    username VARCHAR(50) NOT NULL,
+    dept_code VARCHAR(50),
+    job_number VARCHAR(50),
+    id_card VARCHAR(18),
+    address VARCHAR(200),
+    birth_date DATE,
+    reg_address VARCHAR(200),
+    nation VARCHAR(20),
+    political VARCHAR(20),
+    marital VARCHAR(10),
+    title VARCHAR(50),
+    education VARCHAR(20),
+    phone VARCHAR(20),
+    email VARCHAR(100),
+    intro TEXT,
+    expertise VARCHAR(200),
+    signature_img VARCHAR(200)
+);
+```
+
+如需适配其他数据库(如PostgreSQL、SQL Server等)或需要添加索引、唯一约束等,请告知!
+
+---
+
+_**User**_
+
+帮我改为修改语句来新增字段,并且要添加注释,表名为sys_user
+
+---
+
+_**Assistant**_
+
+好的,下面是针对表 `sys_user` 的**新增字段**的 `ALTER TABLE` 语句,并且每个字段都带有注释(MySQL语法):
+
+```sql
+ALTER TABLE sys_user
+ADD COLUMN alias VARCHAR(50) COMMENT '别名',
+ADD COLUMN role VARCHAR(50) COMMENT '角色',
+ADD COLUMN gender CHAR(1) COMMENT '性别',
+ADD COLUMN department VARCHAR(100) COMMENT '所属科室',
+ADD COLUMN dept_code VARCHAR(50) COMMENT '所属科室编码',
+ADD COLUMN job_number VARCHAR(50) COMMENT '工号',
+ADD COLUMN id_card VARCHAR(18) COMMENT '身份证号码',
+ADD COLUMN address VARCHAR(200) COMMENT '现住地址',
+ADD COLUMN birth_date DATE COMMENT '出生日期',
+ADD COLUMN reg_address VARCHAR(200) COMMENT '户籍地址',
+ADD COLUMN nation VARCHAR(20) COMMENT '民族',
+ADD COLUMN political VARCHAR(20) COMMENT '政治面貌',
+ADD COLUMN marital VARCHAR(10) COMMENT '婚姻状况',
+ADD COLUMN title VARCHAR(50) COMMENT '职称',
+ADD COLUMN education VARCHAR(20) COMMENT '学历',
+ADD COLUMN phone VARCHAR(20) COMMENT '手机号码',
+ADD COLUMN email VARCHAR(100) COMMENT '电子邮箱',
+ADD COLUMN intro TEXT COMMENT '职工简介',
+ADD COLUMN expertise VARCHAR(200) COMMENT '擅长疾病',
+ADD COLUMN signature_img VARCHAR(200) COMMENT '签名图片路径';
+```
+
+> ⚠️ 注意:  
+> - 如果有些字段已经存在于 `sys_user` 表中,请删除对应的 `ADD COLUMN` 语句,避免报错。  
+> - 字段顺序默认加在表最后,如需指定顺序可用 `AFTER` 语法。  
+> - 如需一次性执行,建议先备份数据。
+
+如需针对其他数据库(如 PostgreSQL、SQL Server)或有特殊要求,请告知!
+
+---
+
+_**User**_
+
+帮我改一下,进行列合并
+
+---
+
+_**Assistant**_
+
+你想要将表单中的两列(`<el-col :span="12">`)合并为一列(即一行只显示一个表单项,宽度占满整行),可以将`:span="12"`改为`:span="24"`,并确保每行只放一个`<el-form-item>`。
+
+例如,原来的代码是:
+```vue
+<el-col :span="12">
+  <el-form-item label="用户性别">
+    <el-select v-model="form.sex" placeholder="请选择">
+      <el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
+    </el-select>
+  </el-form-item>
+</el-col>
+```
+和
+```vue
+<el-col :span="12">
+  <el-form-item v-if="form.userId == undefined" label="手机号码" prop="password">
+    <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" type="textarea" rows="5"/>
+  </el-form-item>
+</el-col>
+```
+
+合并后应改为:
+```vue
+<el-col :span="24">
+  <el-form-item label="用户性别">
+    <el-select v-model="form.sex" placeholder="请选择">
+      <el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
+    </el-select>
+  </el-form-item>
+</el-col>
+<el-col :span="24">
+  <el-form-item v-if="form.userId == undefined" label="手机号码" prop="password">
+    <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" type="textarea" rows="5"/>
+  </el-form-item>
+</el-col>
+```
+
+我将帮你把这两处都改为`<el-col :span="24">`,实现列合并。
+
+---
+
+<details>
+            <summary>Searched codebase "el-col :span="12"" • **25** results</summary>
+        
+| File | Lines |
+|------|-------|
+| `src/views/system/user/profile/index.vue` | L44-108 |
+| `src/views/system/user/authRole.vue` | L1-47 |
+| `src/views/system/user/profile/index.vue` | L1-44 |
+| `src/views/system/user/index.vue` | L239-276 |
+| `src/views/system/user/index.vue` | L276-300 |
+| `src/views/system/user/index.vue` | L148-185 |
+| `src/views/system/user/index.vue` | L300-339 |
+| `src/views/system/user/profile/userAvatar.vue` | L1-27 |
+| `src/views/system/user/index.vue` | L62-95 |
+| `src/views/system/user/index.vue` | L95-117 |
+| `src/views/system/user/profile/userAvatar.vue` | L27-81 |
+| `src/views/system/user/index.vue` | L117-148 |
+| `src/views/system/user/index.vue` | L185-239 |
+| `src/views/system/user/index.vue` | L1-36 |
+| `src/views/system/user/profile/onlineDevice.vue` | L1-42 |
+| `src/views/system/user/authRole.vue` | L47-102 |
+| `src/views/system/user/index.vue` | L36-62 |
+| `src/views/system/user/index.vue` | L339-386 |
+| `src/views/system/user/profile/thirdParty.vue` | L1-19 |
+| `src/views/system/user/profile/userInfo.vue` | L1-57 |
+| `src/views/system/user/profile/resetPwd.vue` | L1-38 |
+| `src/views/system/user/index.vue` | L386-435 |
+| `src/views/system/user/index.vue` | L435-511 |
+| `src/views/system/user/profile/userAvatar.vue` | L81-158 |
+| `src/views/system/user/index.vue` | L577-634 |
+
+</details>
+
+---
+
+Read file: src/views/system/user/index.vue
+
+---
+
+Read file: src/views/system/user/index.vue
+
+---
+
+Read file: src/views/system/user/index.vue
+
+---
+
+Read file: src/views/system/user/index.vue
+
+---
+
+Read file: src/views/system/user/index.vue
+
+---
+
+Read file: src/views/system/user/index.vue
+
+---
+
+Read file: src/views/system/user/index.vue
+
+---
+
+Read file: src/views/system/user/index.vue
+
+---
+
+Read file: src/views/system/user/index.vue
+
+---
+
+Read file: src/views/system/user/index.vue
+
+---
+
+_**User**_
+
+行合并呢怎么改
+
+---
+
+_**Assistant**_
+
+如果你想让某一行只显示一个表单项(即“行合并”效果),可以这样做:
+
+### 1. 只保留一个 `<el-col :span="24">`,把表单项放进去
+比如你原来是这样:
+```vue
+<el-row>
+  <el-col :span="12">
+    <el-form-item label="用户性别">
+      <el-select v-model="form.sex" placeholder="请选择">
+        <el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
+      </el-select>
+    </el-form-item>
+  </el-col>
+  <el-col :span="12">
+    <el-form-item v-if="form.userId == undefined" label="手机号码" prop="password">
+      <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" type="textarea" rows="5"/>
+    </el-form-item>
+  </el-col>
+</el-row>
+```
+
+### 2. 修改为每行只一个表单项
+比如只显示“用户性别”:
+```vue
+<el-row>
+  <el-col :span="24">
+    <el-form-item label="用户性别">
+      <el-select v-model="form.sex" placeholder="请选择">
+        <el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
+      </el-select>
+    </el-form-item>
+  </el-col>
+</el-row>
+```
+再下一行只显示“手机号码”:
+```vue
+<el-row>
+  <el-col :span="24">
+    <el-form-item v-if="form.userId == undefined" label="手机号码" prop="password">
+      <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" type="textarea" rows="5"/>
+    </el-form-item>
+  </el-col>
+</el-row>
+```
+
+### 总结
+- 每个 `<el-row>` 只放一个 `<el-col :span="24">`,这样这一行就只显示一个表单项,实现“行合并”。
+- 你可以把所有需要“独占一行”的表单项都这样写。
+
+需要我帮你把具体某几行改成这样吗?如果有具体的行号或表单项,请告诉我!
+
+---
+
+_**User**_
+
+上传图片
+
+---
+
+_**Assistant**_
+
+你想要将“签名图片”字段改为上传图片功能。可以使用 Element Plus 的 `<el-upload>` 组件来实现图片上传。下面是常见的实现方式:
+
+---
+
+### 1. 替换为图片上传组件
+
+将原来的:
+```vue
+<el-input v-model="form.signatureImg" placeholder="请输入签名图片"/>
+```
+
+改为:
+```vue
+<el-upload
+  class="avatar-uploader"
+  action="/your/upload/api"  <!-- 这里填写你的上传接口地址 -->
+  :show-file-list="false"
+  :on-success="handleSignatureSuccess"
+  :before-upload="beforeSignatureUpload"
+>
+  <img v-if="form.signatureImg" :src="form.signatureImg" class="avatar" />
+  <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
+</el-upload>
+```
+
+---
+
+### 2. 在 `<script setup>` 里添加方法
+
+```ts
+const handleSignatureSuccess = (response: any) => {
+  // 假设返回的图片地址在 response.url
+  form.signatureImg = response.url;
+};
+
+const beforeSignatureUpload = (file: File) => {
+  const isImage = file.type.startsWith('image/');
+  if (!isImage) {
+    ElMessage.error('只能上传图片文件!');
+  }
+  return isImage;
+};
+```
+
+---
+
+### 3. 样式(可选)
+
+```css
+.avatar-uploader .avatar {
+  width: 100px;
+  height: 100px;
+  display: block;
+}
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 100px;
+  height: 100px;
+  line-height: 100px;
+  text-align: center;
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+}
+```
+
+---
+
+#### 你只需:
+1. 替换表单项为 `<el-upload>` 代码。
+2. 在 script 里加上处理方法。
+3. 把 `action` 换成你自己的图片上传接口。
+
+需要我帮你直接改在代码里吗?如果有上传接口地址请一并告诉我!
+
+---
+

+ 26 - 0
info.txt

@@ -0,0 +1,26 @@
+ 
+姓名:
+密码:
+别名:
+角色:
+性别: 
+所属科室:
+登录名:
+所属科室编码:
+工号:
+身份证号码:
+现住地址:
+出生日期:
+户籍地址:
+民族:
+政治面貌:
+婚姻状况:
+职称:
+学历:
+手机号码:
+电子邮箱:
+职工简介:
+擅长疾病:
+签名图片:
+ 
+

+ 2 - 0
src/api/system/dept/types.ts

@@ -57,4 +57,6 @@ export interface DeptForm {
   status?: string;
   delFlag?: string;
   ancestors?: string;
+  hospOrDept?: string;
+  logo?: string;
 }

+ 18 - 1
src/api/system/user/types.ts

@@ -58,15 +58,32 @@ export interface UserForm {
   userId?: string;
   deptId?: number;
   userName: string;
+  name?: string;
+  deptCode?: string;
+
+  jobNumber?: string;
+  idCard?: string;
+  address?: string;
+  birthDate?: string;
+  regAddress?: string;
+  nation?: string;
+  political?: string;
+  marital?: string;
+  title?: string;
+  education?: string;
+  intro?: string;
+  expertise?: string;
+  signatureImg?: string;
   nickName?: string;
   password: string;
   phonenumber?: string;
   email?: string;
   sex?: string;
   status: string;
+  alias?: string;
   remark?: string;
   postIds: string[];
-  roleIds: string[];
+  roleIds: string;
 }
 
 export interface UserInfoVO {

+ 1 - 1
src/components/FileUpload/index.vue

@@ -72,7 +72,7 @@ const number = ref(0);
 const uploadList = ref<any[]>([]);
 
 const baseUrl = import.meta.env.VITE_APP_BASE_API;
-const uploadFileUrl = ref(baseUrl + '/resource/oss/upload'); // 上传文件服务器地址
+const uploadFileUrl = ref(baseUrl + '/api/qiniu/upload'); // 上传文件服务器地址
 const headers = ref(globalHeaders());
 
 const fileList = ref<any[]>([]);

+ 6 - 1
src/components/ImageUpload/index.vue

@@ -8,6 +8,7 @@
       :on-success="handleUploadSuccess"
       :before-upload="handleBeforeUpload"
       :limit="limit"
+      :disabled="disabled"
       :accept="fileAccept"
       :on-error="handleUploadError"
       :on-exceed="handleExceed"
@@ -63,6 +64,10 @@ const props = defineProps({
     type: Boolean,
     default: true
   },
+  disabled: {
+    type: Boolean,
+    default: false
+  },  
   // 是否支持压缩,默认否
   compressSupport: {
     type: Boolean,
@@ -80,7 +85,7 @@ const dialogImageUrl = ref('');
 const dialogVisible = ref(false);
 
 const baseUrl = import.meta.env.VITE_APP_BASE_API;
-const uploadImgUrl = ref(baseUrl + '/resource/oss/upload'); // 上传的图片服务器地址
+const uploadImgUrl = ref(baseUrl + '/api/qiniu/upload'); // 上传的图片服务器地址
 const headers = ref(globalHeaders());
 
 const fileList = ref<any[]>([]);

+ 21 - 8
src/views/system/dept/index.vue

@@ -78,27 +78,38 @@
     <el-dialog v-model="dialog.visible" :title="dialog.title" destroy-on-close append-to-body width="700px">
       <el-form ref="deptFormRef" :model="form" :rules="rules" label-width="80px">
         <el-row>
+          <el-col :span="24">
+            <el-radio-group v-model="form.hospOrDept" :disabled="dialog.disabled">
+              <el-radio v-for="dict in hospital_or_department" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
+            </el-radio-group>
+          </el-col>
+
           <el-col :span="12">
-            <el-form-item label="科室名称" prop="deptName">
-              <el-input v-model="form.deptName" placeholder="请输入科室名称" />
+            <el-form-item  :label="form.hospOrDept=='1'?'院区名称':'科室名称'" prop="deptName">
+              <el-input v-model="form.deptName" placeholder="请输入" />
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="所属上级" prop="parentId">
+            <el-form-item :label="form.hospOrDept=='1'?'所属上级':'上级科室'" prop="parentId">
               <el-tree-select
                 v-model="form.parentId"
                 :data="deptOptions"
                 :props="{ value: 'deptId', label: 'deptName', children: 'children' } as any"
                 value-key="deptId"
-                placeholder="选择所属上级"
+                placeholder="选择"
                 check-strictly
               />
             </el-form-item>
           </el-col>
           
           <el-col :span="12">
-            <el-form-item label="科室编码" prop="deptCategory">
-              <el-input v-model="form.deptCategory" placeholder="请输入科室编码" />
+            <el-form-item :label="form.hospOrDept=='1'?'所属上级':'上级科室'" prop="deptCategory">
+              <el-input v-model="form.deptCategory" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="24" v-if="form.hospOrDept=='1'">
+            <el-form-item label="院区logo" prop="logo">
+              <imageUpload v-model="form.logo" :limit="1" :isShowTip="false" />
             </el-form-item>
           </el-col>
           <!-- <el-col :span="12">
@@ -159,6 +170,7 @@ interface DeptOptionsType {
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable'));
+const { hospital_or_department } = toRefs<any>(proxy?.useDict('hospital_or_department'));
 
 const deptList = ref<DeptVO[]>([]);
 const loading = ref(true);
@@ -185,6 +197,7 @@ const initFormData: DeptForm = {
   leader: undefined,
   phone: undefined,
   remark: undefined,
+  hospOrDept:'1',
   status: '0'
 };
 const initData: PageData<DeptForm, DeptQuery> = {
@@ -321,8 +334,8 @@ const handleUpdate = async (row: DeptVO) => {
 const submitForm = () => {
   deptFormRef.value?.validate(async (valid: boolean) => {
     if (valid) {
-      let param=ref<DeptForm>();
-      Object.assign(param,form);
+      let param=ref<DeptForm>({});
+      Object.assign(param.value,form.value);
       param.value.parentId=param.value.parentId?param.value.parentId:0;
       param.value.deptId ? await updateDept(param.value) : await addDept(param.value);
       proxy?.$modal.msgSuccess('操作成功');

+ 1 - 1
src/views/system/role/index.vue

@@ -3,7 +3,7 @@
     <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
       <div v-show="showSearch" class="mb-[10px]">
         <el-card shadow="hover">
-          <el-form ref="queryFormRef" :model="queryParams" :inline="true">           
+          <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="120px">           
             <el-form-item label="角色编码" prop="roleKey">
               <el-input v-model="queryParams.roleKey" placeholder="请输入角色编码" clearable @keyup.enter="handleQuery" />
             </el-form-item>

+ 187 - 100
src/views/system/user/index.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="p-2">
     <el-row :gutter="20">
-      <!-- 部门树 -->
+      <!-- 科室树 -->
       <el-col :lg="4" :xs="24" style="">
         <el-card shadow="hover">
-          <el-input v-model="deptName" placeholder="请输入部门名称" prefix-icon="Search" clearable />
+          <el-input v-model="deptName" placeholder="搜索科室" prefix-icon="Search" clearable />
           <el-tree
             ref="deptTreeRef"
             class="mt-2"
@@ -23,22 +23,23 @@
         <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
           <div v-show="showSearch" class="mb-[10px]">
             <el-card shadow="hover">
-              <el-form ref="queryFormRef" :model="queryParams" :inline="true">
-                <el-form-item label="用户名称" prop="userName">
-                  <el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable @keyup.enter="handleQuery" />
+              <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="150px">
+                <el-form-item label="角色" prop="status">
+                  <el-select v-model="queryParams.status" placeholder="请选择" clearable>
+                    <el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
+                  </el-select>
+                </el-form-item>
+
+                <el-form-item label="登录名/姓名/工号" prop="userName">
+                  <el-input v-model="queryParams.userName" placeholder="请输入" clearable @keyup.enter="handleQuery" />
                 </el-form-item>
-                <el-form-item label="用户昵称" prop="nickName">
+
+               <!--<el-form-item label="用户昵称" prop="nickName">
                   <el-input v-model="queryParams.nickName" placeholder="请输入用户昵称" clearable @keyup.enter="handleQuery" />
                 </el-form-item>
                 <el-form-item label="手机号码" prop="phonenumber">
                   <el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable @keyup.enter="handleQuery" />
                 </el-form-item>
-
-                <el-form-item label="状态" prop="status">
-                  <el-select v-model="queryParams.status" placeholder="用户状态" clearable>
-                    <el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
-                  </el-select>
-                </el-form-item>
                 <el-form-item label="创建时间" style="width: 308px">
                   <el-date-picker
                     v-model="dateRange"
@@ -49,7 +50,7 @@
                     end-placeholder="结束日期"
                     :default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
                   ></el-date-picker>
-                </el-form-item>
+                </el-form-item> -->
                 <el-form-item>
                   <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
                   <el-button icon="Refresh" @click="resetQuery">重置</el-button>
@@ -65,7 +66,7 @@
               <el-col :span="1.5">
                 <el-button v-has-permi="['system:user:add']" type="primary" plain icon="Plus" @click="handleAdd()">新增</el-button>
               </el-col>
-              <el-col :span="1.5">
+              <!-- <el-col :span="1.5">
                 <el-button v-has-permi="['system:user:edit']" type="success" plain :disabled="single" icon="Edit" @click="handleUpdate()">
                   修改
                 </el-button>
@@ -84,51 +85,58 @@
                   <template #dropdown>
                     <el-dropdown-menu>
                       <el-dropdown-item icon="Download" @click="importTemplate">下载模板</el-dropdown-item>
-                      <!-- 注意 由于el-dropdown-item标签是延迟加载的 所以v-has-permi自定义标签不生效 需要使用v-if调用方法执行 -->
+                      注意 由于el-dropdown-item标签是延迟加载的 所以v-has-permi自定义标签不生效 需要使用v-if调用方法执行 
                       <el-dropdown-item v-if="checkPermi(['system:user:import'])" icon="Top" @click="handleImport">导入数据</el-dropdown-item>
                       <el-dropdown-item v-if="checkPermi(['system:user:export'])" icon="Download" @click="handleExport">导出数据</el-dropdown-item>
                     </el-dropdown-menu>
                   </template>
                 </el-dropdown>
-              </el-col>
+              </el-col>-->
               <right-toolbar v-model:show-search="showSearch" :columns="columns" :search="true" @query-table="getList"></right-toolbar>
             </el-row>
           </template>
 
-          <el-table v-loading="loading" border :data="userList" @selection-change="handleSelectionChange">
+          <el-table v-loading="loading" stripe border :data="userList" @selection-change="handleSelectionChange">
             <el-table-column type="selection" width="50" align="center" />
-            <el-table-column v-if="columns[0].visible" key="userId" label="用户编号" align="center" prop="userId" />
-            <el-table-column v-if="columns[1].visible" key="userName" label="用户名称" align="center" prop="userName" :show-overflow-tooltip="true" />
-            <el-table-column v-if="columns[2].visible" key="nickName" label="用户昵称" align="center" prop="nickName" :show-overflow-tooltip="true" />
-            <el-table-column v-if="columns[3].visible" key="deptName" label="部门" align="center" prop="deptName" :show-overflow-tooltip="true" />
-            <el-table-column v-if="columns[4].visible" key="phonenumber" label="手机号码" align="center" prop="phonenumber" width="120" />
-            <el-table-column v-if="columns[5].visible" key="status" label="状态" align="center">
-              <template #default="scope">
-                <el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
-              </template>
+            <!-- <el-table-column  key="userId" label="用户编号" align="center" prop="userId" /> -->
+            <el-table-column key="name" label="姓名" align="center" prop="name" :show-overflow-tooltip="true" />
+            <el-table-column   key="userName" label="登录名" align="center" prop="userName" :show-overflow-tooltip="true" width="130"/>
+            <el-table-column   key="jobNumber" label="工号" align="center" prop="jobNumber" :show-overflow-tooltip="true" width="130">
+            <template #default="scope">
+              {{scope.row.jobNumber?scope.row.jobNumber:'--'}}           
+            </template>
             </el-table-column>
-
-            <el-table-column v-if="columns[6].visible" label="创建时间" align="center" prop="createTime" width="160">
-              <template #default="scope">
-                <span>{{ scope.row.createTime }}</span>
-              </template>
+            <el-table-column   key="email" label="用户邮箱" align="center" prop="email" :show-overflow-tooltip="true" width="170" >
+            <template #default="scope">
+              {{scope.row.email?scope.row.email:'--'}}           
+            </template>
             </el-table-column>
-
-            <el-table-column label="操作" fixed="right" width="180" class-name="small-padding fixed-width">
+            <el-table-column   key="phonenumber" label="手机号码" align="center" prop="phonenumber" width="130"  >
+            <template #default="scope">
+              {{scope.row.phonenumber?scope.row.phonenumber:'--'}}           
+            </template>
+            </el-table-column>
+            <el-table-column   key="deptName" label="所属科室" align="center" prop="deptName" :show-overflow-tooltip="true" width="170"/>  
+            <el-table-column   key="roleName" label="角色" align="center" prop="roleName" :show-overflow-tooltip="true" width="170" />  
+            <el-table-column  key="loginDate" label="上次登录时间" align="center" prop="loginDate" width="170" />
+            <el-table-column label="操作" fixed="right" width="430" class-name="small-padding fixed-width">
               <template #default="scope">
-                <el-tooltip v-if="scope.row.userId !== 1" content="修改" placement="top">
-                  <el-button v-hasPermi="['system:user:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
+                <el-tooltip v-if="scope.row.userId !== 1" content="编辑" placement="top">
+                  <el-button v-hasPermi="['system:user:edit']" link type="primary" icon="Edit" @click="handleUpdate(false,scope.row)">编辑</el-button>
+                </el-tooltip>
+                <el-tooltip v-if="scope.row.userId !== 1" content="详情" placement="top">
+                  <el-button v-hasPermi="['system:user:edit']" link type="primary" icon="View" @click="handleUpdate(true,scope.row)">详情</el-button>
                 </el-tooltip>
                 <el-tooltip v-if="scope.row.userId !== 1" content="删除" placement="top">
-                  <el-button v-hasPermi="['system:user:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button>
+                  <el-button v-hasPermi="['system:user:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
                 </el-tooltip>
 
                 <el-tooltip v-if="scope.row.userId !== 1" content="重置密码" placement="top">
-                  <el-button v-hasPermi="['system:user:resetPwd']" link type="primary" icon="Key" @click="handleResetPwd(scope.row)"></el-button>
+                  <el-button v-hasPermi="['system:user:resetPwd']" link type="primary" icon="Key" @click="handleResetPwd(scope.row)">重置密码</el-button>
                 </el-tooltip>
 
                 <el-tooltip v-if="scope.row.userId !== 1" content="分配角色" placement="top">
-                  <el-button v-hasPermi="['system:user:edit']" link type="primary" icon="CircleCheck" @click="handleAuthRole(scope.row)"></el-button>
+                  <el-button v-hasPermi="['system:user:edit']" link type="primary" icon="CircleCheck" @click="handleAuthRole(scope.row)">分配角色</el-button>
                 </el-tooltip>
               </template>
             </el-table-column>
@@ -146,103 +154,177 @@
     </el-row>
 
     <!-- 添加或修改用户配置对话框 -->
-    <el-dialog ref="formDialogRef" v-model="dialog.visible" :title="dialog.title" width="600px" append-to-body @close="closeDialog">
-      <el-form ref="userFormRef" :model="form" :rules="rules" label-width="80px">
+    <el-dialog ref="formDialogRef" v-model="dialog.visible" :title="dialog.title" width="800px" append-to-body @close="closeDialog">
+      <el-form ref="userFormRef" :model="form" :rules="rules" label-width="100px">
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="姓名" prop="name">
+              <el-input v-model="form.name" placeholder="请输入姓名" maxlength="11"  :disabled="dialog.disabled"/>
+            </el-form-item>
+          </el-col>           
+          <el-col :span="12">
+            <el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
+              <el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password :disabled="dialog.disabled" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+
         <el-row>
           <el-col :span="12">
-            <el-form-item label="用户昵称" prop="nickName">
-              <el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" />
+            <el-form-item label="别名" prop="alias">
+              <el-input v-model="form.alias" placeholder="请输入别名" maxlength="30" :disabled="dialog.disabled" />
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="归属部门" prop="deptId">
-              <el-tree-select
+            <el-form-item label="角色" prop="roleIds">
+              <el-select v-model="form.roleIds" filterable placeholder="请选择" :disabled="dialog.disabled">
+                <el-option
+                  v-for="item in roleOptions"
+                  :key="item.roleId"
+                  :label="item.roleName"
+                  :value="item.roleId"
+                  :disabled="item.status == '1'"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="性别" prop="sex">
+              <el-select v-model="form.sex" placeholder="请选择" :disabled="dialog.disabled">
+                <el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="所属科室" prop="deptId" >
+              <el-tree-select :disabled="dialog.disabled"
                 v-model="form.deptId"
                 :data="enabledDeptOptions"
                 :props="{ value: 'id', label: 'label', children: 'children' } as any"
                 value-key="id"
-                placeholder="请选择归属部门"
+                placeholder="请选择所属科室"
                 check-strictly
                 @change="handleDeptChange"
               />
             </el-form-item>
           </el-col>
         </el-row>
+
         <el-row>
           <el-col :span="12">
-            <el-form-item label="手机号码" prop="phonenumber">
-              <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
+            <el-form-item label="登录名" prop="userName" >
+              <el-input v-model="form.userName" placeholder="请输入登录名" maxlength="30" :disabled="dialog.disabled" />
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="邮箱" prop="email">
-              <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
+            <el-form-item label="所属科室编码" prop="deptCode">
+              <el-input v-model="form.deptCode" placeholder="请输入"  :disabled="dialog.disabled" />
+            </el-form-item>             
+          </el-col>
+        </el-row>
+
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="工号" prop="jobNumber">
+              <el-input v-model="form.jobNumber" placeholder="请输入工号" :disabled="dialog.disabled"/>
             </el-form-item>
           </el-col>
+          <el-col :span="12">            
+          </el-col>
         </el-row>
+
+        <el-divider />
+
         <el-row>
           <el-col :span="12">
-            <el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName">
-              <el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" />
+            <el-form-item label="身份证号码" prop="idCard">
+              <el-input v-model="form.idCard" placeholder="请输入身份证号码" :disabled="dialog.disabled" />
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
-              <el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password />
+            <el-form-item label="现住地址" prop="address">
+              <el-input v-model="form.address" placeholder="请输入现住地址" :disabled="dialog.disabled"/>
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="12">
-            <el-form-item label="用户性别">
-              <el-select v-model="form.sex" placeholder="请选择">
-                <el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
-              </el-select>
+            <el-form-item  label="出生日期" prop="birthDate">
+              <el-input v-model="form.birthDate" placeholder="请输入出生日期" :disabled="dialog.disabled"/>
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="状态">
-              <el-radio-group v-model="form.status">
-                <el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
-              </el-radio-group>
+            <el-form-item  label="户籍地址" prop="regAddress">
+              <el-input v-model="form.regAddress" placeholder="请输入户籍地址" :disabled="dialog.disabled"/>
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="12">
-            <el-form-item label="岗位">
-              <el-select v-model="form.postIds" multiple placeholder="请选择">
-                <el-option
-                  v-for="item in postOptions"
-                  :key="item.postId"
-                  :label="item.postName"
-                  :value="item.postId"
-                  :disabled="item.status == '1'"
-                ></el-option>
-              </el-select>
+            <el-form-item  label="民族" prop="nation">
+              <el-input v-model="form.nation" placeholder="请输入民族" :disabled="dialog.disabled"/>
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="角色" prop="roleIds">
-              <el-select v-model="form.roleIds" filterable multiple placeholder="请选择">
-                <el-option
-                  v-for="item in roleOptions"
-                  :key="item.roleId"
-                  :label="item.roleName"
-                  :value="item.roleId"
-                  :disabled="item.status == '1'"
-                ></el-option>
-              </el-select>
+            <el-form-item  label="政治面貌" prop="political">
+              <el-input v-model="form.political" placeholder="请输入政治面貌" :disabled="dialog.disabled"/>
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
-          <el-col :span="24">
-            <el-form-item label="备注">
-              <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
+          <el-col :span="12">
+            <el-form-item label="婚姻状况" prop="marital">
+              <el-input v-model="form.marital" placeholder="请输入婚姻状况" :disabled="dialog.disabled"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="职称" prop="title">
+              <el-input v-model="form.title" placeholder="请输入职称" :disabled="dialog.disabled"/>
             </el-form-item>
           </el-col>
         </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item  label="学历" prop="education">
+              <el-input v-model="form.education" placeholder="请输入学历" :disabled="dialog.disabled" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item  label="手机号码" prop="phonenumber">
+              <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" :disabled="dialog.disabled"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row>
+          <el-col :span="12">
+            <el-form-item  label="电子邮箱" prop="email">
+              <el-input v-model="form.email" placeholder="请输入电子邮箱" :disabled="dialog.disabled"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item  label="职工简介" prop="intro">
+              <el-input v-model="form.intro" placeholder="请输入"  type="textarea" :rows="3" :disabled="dialog.disabled"/>
+            </el-form-item>
+          </el-col>
+        </el-row> 
+
+        <el-row>          
+          <el-col :span="12">
+            <el-form-item  label="擅长疾病" prop="expertise">
+              <el-input v-model="form.expertise" placeholder="请输入" type="textarea" :rows="6" :disabled="dialog.disabled"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item  label="签名图片" prop="signatureImg">
+              <imageUpload v-model="form.signatureImg" :limit="1" :isShowTip="false" :disabled="dialog.disabled"/>
+              <span style="font-size: 11px;color: red;">上传的签名图片将备用于复核管理的复核人签名</span>
+            </el-form-item>           
+          </el-col>
+        </el-row>
       </el-form>
       <template #footer>
         <div class="dialog-footer">
@@ -338,7 +420,7 @@ const columns = ref<FieldOption[]>([
   { key: 0, label: `用户编号`, visible: false, children: [] },
   { key: 1, label: `用户名称`, visible: true, children: [] },
   { key: 2, label: `用户昵称`, visible: true, children: [] },
-  { key: 3, label: `部门`, visible: true, children: [] },
+  { key: 3, label: `科室`, visible: true, children: [] },
   { key: 4, label: `手机号码`, visible: true, children: [] },
   { key: 5, label: `状态`, visible: true, children: [] },
   { key: 6, label: `创建时间`, visible: true, children: [] }
@@ -352,6 +434,7 @@ const formDialogRef = ref<ElDialogInstance>();
 
 const dialog = reactive<DialogOption>({
   visible: false,
+  disabled:false,
   title: ''
 });
 
@@ -391,7 +474,7 @@ const initData: PageData<UserForm, UserQuery> = {
         trigger: 'blur'
       }
     ],
-    nickName: [{ required: true, message: '用户昵称不能为空', trigger: 'blur' }],
+    sex: [{ required: true, message: '请选择性别', trigger: 'blur' }],
     password: [
       { required: true, message: '用户密码不能为空', trigger: 'blur' },
       {
@@ -409,12 +492,11 @@ const initData: PageData<UserForm, UserQuery> = {
         trigger: ['blur', 'change']
       }
     ],
-    phonenumber: [
-      {
-        pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
-        message: '请输入正确的手机号码',
-        trigger: 'blur'
-      }
+    name: [
+     { required: true, message: '姓名不能为空', trigger: 'blur' }       
+    ],
+    deptId: [
+     { required: true, message: '请选择所属科室', trigger: 'blur' }    
     ],
     roleIds: [{ required: true, message: '用户角色不能为空', trigger: 'blur' }]
   }
@@ -428,7 +510,7 @@ const filterNode = (value: string, data: any) => {
   if (!value) return true;
   return data.label.indexOf(value) !== -1;
 };
-/** 根据名称筛选部门树 */
+/** 根据名称筛选科室树 */
 watchEffect(
   () => {
     deptTreeRef.value?.filter(deptName.value);
@@ -438,6 +520,8 @@ watchEffect(
   }
 );
 
+
+
 /** 查询用户列表 */
 const getList = async () => {
   loading.value = true;
@@ -447,16 +531,18 @@ const getList = async () => {
   total.value = res.total;
 };
 
-/** 查询部门下拉树结构 */
+/** 查询科室下拉树结构 */
 const getDeptTree = async () => {
   const res = await api.deptTreeSelect();
   deptOptions.value = res.data;
   enabledDeptOptions.value = filterDisabledDept(res.data);
 };
 
-/** 过滤禁用的部门 */
+const deptJson= ref({});
+/** 过滤禁用的科室 */
 const filterDisabledDept = (deptList: DeptTreeVO[]) => {
   return deptList.filter((dept) => {
+    deptJson.value[dept.id.toString()]=dept;
     if (dept.disabled) {
       return false;
     }
@@ -608,12 +694,13 @@ const handleAdd = async () => {
 };
 
 /** 修改按钮操作 */
-const handleUpdate = async (row?: UserForm) => {
+const handleUpdate = async (disabled:boolean,row?: UserForm ) => {
   reset();
   const userId = row?.userId || ids.value[0];
   const { data } = await api.getUser(userId);
   dialog.visible = true;
   dialog.title = '修改用户';
+  dialog.disabled = disabled;
   Object.assign(form.value, data.user);
   postOptions.value = data.posts;
   roleOptions.value = data.roles;
@@ -653,7 +740,7 @@ const resetForm = () => {
   form.value.status = '1';
 };
 onMounted(() => {
-  getDeptTree(); // 初始化部门数据
+  getDeptTree(); // 初始化科室数据
   getList(); // 初始化列表数据
   proxy?.getConfigKey('sys.user.initPassword').then((response) => {
     initPassword.value = response.data;
@@ -661,8 +748,8 @@ onMounted(() => {
 });
 
 async function handleDeptChange(value: number | string) {
-  const response = await optionselect(value);
-  postOptions.value = response.data;
-  form.value.postIds = [];
+  let dept=deptJson.value[value.toString()]
+  form.value.deptCode=dept.deptCategory;
+  console.log(dept,'+++++++++++++++++',value.toString() );
 }
 </script>