Selaa lähdekoodia

feat(api): 旧系统 staff list

gemercheung 3 vuotta sitten
vanhempi
commit
57be9b0246
3 muutettua tiedostoa jossa 19 lisäystä ja 14 poistoa
  1. 2 2
      src/api/staff/list.ts
  2. 1 1
      src/api/staff/model.ts
  3. 16 11
      src/views/dashboard/staff/list.vue

+ 2 - 2
src/api/staff/list.ts

@@ -1,5 +1,5 @@
 import { defHttp } from '/@/utils/http/axios';
 import { defHttp } from '/@/utils/http/axios';
-import { PageParams, RentListGetResultModel } from './model';
+import { PageParams, ListGetResultModel } from './model';
 
 
 enum Api {
 enum Api {
   pageList = '/basic-api/sys/user/staffList',
   pageList = '/basic-api/sys/user/staffList',
@@ -10,7 +10,7 @@ enum Api {
  */
  */
 
 
 export const ListApi = (params: PageParams) =>
 export const ListApi = (params: PageParams) =>
-  defHttp.get<RentListGetResultModel>({
+  defHttp.get<ListGetResultModel>({
     url: Api.pageList,
     url: Api.pageList,
     params,
     params,
     headers: {
     headers: {

+ 1 - 1
src/api/staff/model.ts

@@ -17,4 +17,4 @@ export interface StaffListItem {
 /**
 /**
  * @description: Request list return value
  * @description: Request list return value
  */
  */
-export type RentListGetResultModel = BasicFetchResult<StaffListItem>;
+export type ListGetResultModel = BasicFetchResult<StaffListItem>;

+ 16 - 11
src/views/dashboard/staff/list.vue

@@ -8,6 +8,9 @@
       <template #status="{ record }">
       <template #status="{ record }">
         {{ renderStatus(record.status) }}
         {{ renderStatus(record.status) }}
       </template>
       </template>
+      <template #createTime="{ record }">
+        <Time :value="record.createTime" mode="datetime" />
+      </template>
       <template #action="{ record }">
       <template #action="{ record }">
         <TableAction
         <TableAction
           :actions="[
           :actions="[
@@ -43,9 +46,10 @@
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useI18n } from '/@/hooks/web/useI18n';
   // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
   // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
   import { useGo } from '/@/hooks/web/usePage';
   import { useGo } from '/@/hooks/web/usePage';
+  import { Time } from '/@/components/Time';
 
 
   export default defineComponent({
   export default defineComponent({
-    components: { BasicTable, TableAction },
+    components: { BasicTable, TableAction, Time },
     setup() {
     setup() {
       const { createMessage } = useMessage();
       const { createMessage } = useMessage();
       const go = useGo();
       const go = useGo();
@@ -53,29 +57,29 @@
       const columns: BasicColumn[] = [
       const columns: BasicColumn[] = [
         {
         {
           title: 'ID',
           title: 'ID',
-          dataIndex: 'id',
+          dataIndex: 'userId',
           fixed: 'left',
           fixed: 'left',
           width: 60,
           width: 60,
         },
         },
         {
         {
           title: '所属公司',
           title: '所属公司',
-          dataIndex: 'company',
+          dataIndex: 'deptName',
           width: 160,
           width: 160,
         },
         },
         {
         {
           title: '员工名称',
           title: '员工名称',
-          dataIndex: 'name',
+          dataIndex: 'username',
           width: 80,
           width: 80,
         },
         },
         {
         {
           title: '手机',
           title: '手机',
-          dataIndex: 'phone',
+          dataIndex: 'mobile',
           width: 80,
           width: 80,
         },
         },
         {
         {
           title: '角色',
           title: '角色',
-          dataIndex: 'role',
-          slots: { customRender: 'role' },
+          dataIndex: 'roleName',
+          // slots: { customRender: 'role' },
           sorter: true,
           sorter: true,
           width: 80,
           width: 80,
         },
         },
@@ -90,6 +94,7 @@
         {
         {
           title: '创建时间',
           title: '创建时间',
           dataIndex: 'createTime',
           dataIndex: 'createTime',
+          slots: { customRender: 'createTime' },
           width: 130,
           width: 130,
         },
         },
         // {
         // {
@@ -131,8 +136,8 @@
         fetchSetting: {
         fetchSetting: {
           pageField: 'pageSize',
           pageField: 'pageSize',
           sizeField: 'pageNum',
           sizeField: 'pageNum',
-          // listField: 'list',
-          // totalField: 'totalCount',
+          listField: 'list',
+          totalField: 'totalCount',
         },
         },
       });
       });
 
 
@@ -148,9 +153,9 @@
       }
       }
       function renderStatus(type: number): string {
       function renderStatus(type: number): string {
         switch (type) {
         switch (type) {
-          case 0:
-            return '正常';
           case 1:
           case 1:
+            return '正常';
+          case 0:
             return '非正常';
             return '非正常';
           default:
           default:
             return '';
             return '';