Bladeren bron

医疗版修复

周玉佂 1 dag geleden
bovenliggende
commit
259e84fbf3

+ 10 - 52
src/components/Chat/ChatComponent/index.vue

@@ -36,7 +36,7 @@
         </file-upload>
       </div>
       <div class="edit-div-area">
-        <EditDiv class="textarea" @change-text="changeText" />
+        <EditDiv class="textarea" style="height: 100%" @change-text="changeText" />
       </div>
       <el-button type="primary" class="send-btn" @click="mineSend()">发送 </el-button>
     </div>
@@ -101,61 +101,19 @@ const userStore = useUserStore()
 
 let messageList = ref([
   {
-    date: 1713426832728,
-    messages: [{ id: '00001', name: '张美丽', time: 1713401632728, text: '李医生你好' }]
+    date: null,
+    messages: [{ id: '', name: '', time: null, text: '' }]
   },
   {
-    date: 1713426832728,
+    date: null,
     messages: [
-      { id: '00001', name: '张美丽', time: 1713401632728, text: '李医生你好' },
+      { id: '', name: '', time: null, text: '' },
       {
-        id: '00001',
-        name: '张美丽',
-        time: 1713401752728,
+        id: '',
+        name: '',
+        time: null,
         img: '',
-        text: '李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好'
-      },
-      {
-        id: '00001',
-        name: '张美丽',
-        time: 1713402952728,
-        text: '',
-        img: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'
-      },
-      {
-        id: '00001',
-        name: '张美丽',
-        time: 1713403132728,
-        text: '',
-        img: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'
-      },
-      {
-        id: '00002',
-        name: '自己',
-        time: 1713406732728,
-        img: '',
-        text: '张美丽,你好'
-      },
-      {
-        id: '00002',
-        name: '自己',
-        time: 1713406732728,
-        img: '',
-        text: '张美丽,你好'
-      },
-      {
-        id: '00002',
-        name: '自己',
-        time: 1713407752728,
-        img: '',
-        text: '{{{&#128105;‍&#128105;‍&#128103;‍&#128103;}}}李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好李医生你好'
-      },
-      {
-        id: '00002',
-        name: '自己',
-        time: 1713407952728,
-        text: '',
-        img: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'
+        text: ''
       }
     ]
   }
@@ -345,7 +303,7 @@ function gQuerys() {
           console.log(res, 'res')
           messageList.value = [
             {
-              date: c[0].ctime,
+              date: c[0] ? c[0].ctime : '',
               messages: c.map((item) => {
                 return { id: item.sendId, name: item.sendName, time: item.sendTime, text: item.content, img: '' }
               })

+ 3 - 3
src/components/Chat/EditDiv/index.vue

@@ -2,7 +2,7 @@
   <el-scrollbar>
     <div
       id="message-container"
-      class="text-area w-full h-full overflow-auto text-24px"
+      class="text-area w-full h-full overflow-auto text-24px h-[200px]"
       v-html="innerText"
       contenteditable="plaintext-only"
       @paste="handlePaste"
@@ -28,8 +28,8 @@ const innerText = ref('')
 let messageContainer = null
 
 const handlePaste = (event) => {
-  console.log(event,31);
-  
+  console.log(event, 31)
+
   const clipboardData = event.clipboardData || event.originalEvent.clipboardData
   const items = clipboardData.items
   let isImg = false

+ 3 - 3
src/views/information/updatePsw/index.vue

@@ -103,15 +103,15 @@ const validatePass2 = (rule: any, value: any, callback: any) => {
 const rules = reactive({
   oldPassword: [
     { required: true, message: '请输入旧密码', trigger: 'blur' },
-    { min: 6, max: 20, message: '长度应为 6 到 50', trigger: 'blur' }
+    { min: 6, max: 20, message: '长度应为 6 到 20', trigger: 'blur' }
   ],
   password: [
     { validator: validatePass, trigger: 'blur' },
-    { min: 6, max: 20, message: '长度应为 6 到 50', trigger: 'blur' }
+    { min: 6, max: 20, message: '长度应为 6 到 20', trigger: 'blur' }
   ],
   confirmPsw: [
     { validator: validatePass2, trigger: 'blur' },
-    { min: 6, max: 20, message: '长度应为 6 到 50', trigger: 'blur' }
+    { min: 6, max: 20, message: '长度应为 6 到 20', trigger: 'blur' }
   ]
 })
 

+ 22 - 6
src/views/system/user/index.vue

@@ -117,7 +117,7 @@
         </el-form-item>
 
         <el-form-item label="角色" prop="role">
-          <el-select v-model="formData.role" placeholder="请选择">
+          <el-select v-model="formData.role" multiple placeholder="请选择">
             <el-option v-for="item in roleList" :key="item.value" :label="item.label" :value="item.value" />
           </el-select>
         </el-form-item>
@@ -177,7 +177,21 @@ const queryParams = reactive<UserPageQuery>({
 
 const total = ref(0) // 数据总数
 const pageData = ref<UserPageVO[]>() // 用户分页数据
-const roleList = ref<OptionType[]>() // 角色下拉数据源
+// const roleList = ref<OptionType[]>() // 角色下拉数据源
+const roleList = ref([
+  {
+    label: '管理员',
+    value: '1'
+  },
+  {
+    label: '医生',
+    value: '2'
+  },
+  {
+    label: '患者',
+    value: '3'
+  }
+]) // 角色下拉数据源
 
 // 弹窗对象
 const dialog = reactive({
@@ -224,6 +238,7 @@ function handleQuery() {
   loading.value = true
   UserAPI.getPage(queryParams)
     .then((data) => {
+      console.log(data.records, '用户数据data.records')
       pageData.value = data.records
       total.value = data.total
     })
@@ -250,7 +265,7 @@ function openDialog(row?: UserPageVO) {
     dialog.title = '修改用户'
     let tempData = deepClone(row)
     formData.value = tempData
-    formData.value.role = tempData.roles[0]
+    formData.value.role = tempData.roles
   } else {
     dialog.title = '新增用户'
   }
@@ -271,7 +286,7 @@ function resetForm() {
     avatar: '',
     sex: '',
     ctime: '',
-    status: '',
+    status: '1',
     note: '',
     roles: []
   }
@@ -285,7 +300,8 @@ function handleSubmit() {
     if (valid) {
       loading.value = true
       const userId = formData.value.id
-      formData.value.roles = [formData.value.role!]
+      console.log(formData.value.role, 'formData.value.role')
+      formData.value.roles = formData.value.role
       if (userId) {
         UserAPI.update(formData.value)
           .then(() => {
@@ -367,7 +383,7 @@ function getUserRoleStr(roles: string[]) {
 }
 
 onMounted(async () => {
-  roleList.value = await loadRoleOptions()
+  // roleList.value = await loadRoleOptions()
   handleQuery()
 })
 </script>