Ver código fonte

feat: (staff) list add avatar

gemercheung 2 anos atrás
pai
commit
4097ca497f
1 arquivos alterados com 18 adições e 1 exclusões
  1. 18 1
      src/views/staff/list.vue

+ 18 - 1
src/views/staff/list.vue

@@ -24,6 +24,9 @@
       <template #createTime="{ record }">
         <Time :value="record.createTime" mode="datetime" />
       </template>
+      <template #head="{ record }">
+        <TableImg :size="120" :simpleShow="true" :imgList="[record.head]" />
+      </template>
       <!-- , -->
       <template #action="{ record }">
         <TableAction
@@ -56,7 +59,14 @@
 </template>
 <script lang="ts">
   import { defineComponent, computed, onMounted, ref } from 'vue';
-  import { BasicTable, useTable, BasicColumn, FormProps, TableAction } from '/@/components/Table';
+  import {
+    BasicTable,
+    useTable,
+    BasicColumn,
+    FormProps,
+    TableAction,
+    TableImg,
+  } from '/@/components/Table';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { useModal } from '/@/components/Modal';
   import { uploadApi } from '/@/api/sys/upload';
@@ -81,6 +91,7 @@
       DetailsModal,
       DelListModal,
       Alert,
+      TableImg,
     },
     emits: ['register'],
     setup() {
@@ -147,6 +158,12 @@
             return record.permList && record.permList.join();
           },
         },
+        {
+          title: '头像',
+          dataIndex: 'head',
+          slots: { customRender: 'head' },
+          width: 130,
+        },
 
         {
           title: t('routes.staff.createTime'),