wzdxx1314@163.com 1 年間 前
コミット
38a6b511b9

+ 6 - 6
src/components/navbar/components/dropdowns/ProfileDropdown.vue

@@ -10,7 +10,7 @@
       <va-dropdown-content class="profile-dropdown__content">
         <va-list-item v-for="option in options" :key="option.name" class="p-2">
           <router-link :to="{ name: option.redirectTo }" class="profile-dropdown__item">
-            {{ t(`user.${option.name}`) }}
+            {{ option.name}}
           </router-link>
         </va-list-item>
       </va-dropdown-content>
@@ -32,12 +32,12 @@
     }>(),
     {
       options: () => [
+        // {
+        //   name: 'profile',
+        //   redirectTo: '',
+        // },
         {
-          name: 'profile',
-          redirectTo: '',
-        },
-        {
-          name: 'logout',
+          name: '注销登录',
           redirectTo: 'login',
         },
       ],

+ 4 - 1
src/pages/auth/login/Login.vue

@@ -65,6 +65,7 @@
 
   const img = ref('')
   const captcha = ref('')
+  const captchaKey = ref('')
   const email = ref('')
   const loading = ref(false)
   const password = ref('')
@@ -79,7 +80,8 @@
   })
   function getCaptcha() {
     $api.getCaptcha().then((res) => {
-      img.value = res.result
+      img.value = res.result.captcha
+      captchaKey.value = res.result.captchaKey
     })
   }
   function onsubmit() {
@@ -95,6 +97,7 @@
       userName: email.value,
       password: password.value,
       captcha: captcha.value,
+      captchaKey: captcha.value,
       rememberMe: keepLoggedIn.value,
     }
     $api

+ 1 - 0
src/pages/system/module/orgTree.vue

@@ -79,5 +79,6 @@
   }
   .marginl-10{
     margin-left: 10px;
+    margin-top: 4px;
   }
 </style>

+ 56 - 27
src/pages/system/roleManage/module/previewManByRoleBtn.vue

@@ -1,53 +1,82 @@
 <template>
   <div class="opBtn">
-    <VaButton color="info" :round="false" size="small" icon="preview" class="mr-6 mb-2" @click="showModal = true">
+    <VaButton color="info" :round="false" size="small" icon="preview" class="mr-6 mb-2" @click="goSee">
       查看角色用户
     </VaButton>
     <VaModal
-      v-model="showModal"
+      :model-value="showModal"
       max-height="600px"
+      hide-default-actions
       :noDismiss="true"
       max-width="800px"
-      ok-text="提交"
-      cancelText="取消"
+
     >
-      <h3 class="va-h3">用户列表</h3>
-      <VaDataTable :items="items">
+      <template #header>
+        <h3 class="va-h3">用户列表</h3>
+      </template>
+      <template #footer>
+        <VaButton @click='showModal=false'>关闭</VaButton>
+      </template>
+
+      <VaDataTable :items="items" :columns='columns'>
         <template #cell(img)="{ rowData }">
           <VaAvatar :src="rowData.img" />
         </template>
       </VaDataTable>
+      <div class="pagination">
+        <VaPagination
+          @click="update"
+          v-model="pageInfo.pageNum"
+          :total="pageInfo.total"
+          :page-size="pageInfo.pageSize"
+          :visible-pages="4"
+          class="justify-center sm:justify-start"
+        />
+      </div>
     </VaModal>
   </div>
 </template>
 
 <script>
+  import dict from '../../../../common/dict'
   export default {
     name: 'previewManByRoleBtn',
+    props:{
+      params:{
+        default:()=>{}
+      }
+    },
+    methods:{
+      goSee(){
+        this.showModal = true
+        this.getList()
+      },
+      update(){
+        getList()
+      },
+      getList(){
+        let params = {
+          pageNum: Math.ceil(this.pageInfo.pageNum / this.pageInfo.pageSize),
+          pageSize: this.pageInfo.pageSize,
+          roleIds: this.params.id,
+        }
+        this.$api.getUserList(params).then((res) => {
+          this.loading = false
+          this.pageInfo.total = res.result.total
+          this.items = res.result.records
+        })
+      },
+    },
     data() {
       return {
         showModal: false,
-        items: [
-          {
-            img: 'https://randomuser.me/api/portraits/women/5.jpg',
-            name: 'Audrey Clay',
-            phone: '13327777156',
-          },
-          {
-            img: 'https://randomuser.me/api/portraits/men/1.jpg',
-            name: 'Aguirre Klein',
-            phone: '13327777156',
-          },
-          {
-            img: 'https://randomuser.me/api/portraits/men/3.jpg',
-            name: 'Tucker Kaufman',
-            phone: '13327777156',
-          },
-          {
-            img: 'https://randomuser.me/api/portraits/men/5.jpg',
-            name: 'Herbert Keller',
-            phone: '286 NW. Shore St.Longwood, FL 32779',
-          },
+        pageInfo:dict.pageInfo,
+        items: [],
+        columns: [
+          { key: 'userName', label: 'userName' },
+          { key: 'name', label: 'name' },
+          { key: 'phone', label: 'phone' },
+          { key: 'gender', label: 'gender' },
         ],
       }
     },

+ 5 - 1
src/pages/system/userManage/module/workSpace.vue

@@ -16,6 +16,7 @@
       </div>
       <div class="pagination">
         <VaPagination
+          @click="update"
           v-model="pageInfo.pageNum"
           :total="pageInfo.total"
           :page-size="pageInfo.pageSize"
@@ -41,6 +42,9 @@
       deleteUserBtn,
     },
     methods: {
+      update(v) {
+        this.getList()
+      },
       getTime(time){
         return moment(new Date(parseInt(time))).format('yyyy-MM-DD')
       },
@@ -55,7 +59,7 @@
         this.loading = true
         let params = {
           userName: this.$refs.searchForm.form.userName,
-          pageNum: this.pageInfo.pageNum,
+          pageNum: Math.ceil(this.pageInfo.pageNum / this.pageInfo.pageSize),
           pageSize: this.pageInfo.pageSize,
           orgId: this.orgId || '',
           roleIds: this.$refs.searchForm.form.roleId.join(','),