Преглед на файлове

fix: 后端接口字段更改,接口定义个更新

lanjianrong преди 4 години
родител
ревизия
cbc628f9a3

+ 1 - 4
config/config.dev.ts

@@ -1,6 +1,6 @@
 // https://umijs.org/config/
 import { defineConfig } from 'umi'
-import WebpackWindiCSSPlugin from 'windicss-webpack-plugin/dist/index'
+
 export default defineConfig({
   plugins: [
     // https://github.com/zthxxx/react-dev-inspector
@@ -24,9 +24,6 @@ export default defineConfig({
     ],
     babelOptions: {}
   },
-  chainWebpack(config) {
-    config.plugin('windicss').use(WebpackWindiCSSPlugin)
-  },
   webpack5: {
     // lazyCompilation: {},
   }

+ 4 - 1
config/config.ts

@@ -5,7 +5,7 @@ import { join } from 'path'
 import defaultSettings from './defaultSettings'
 import proxy from './proxy'
 import routes from './routes'
-
+import WindiCSSPlugin from 'windicss-webpack-plugin'
 const { REACT_APP_ENV } = process.env
 
 export default defineConfig({
@@ -50,6 +50,9 @@ export default defineConfig({
   manifest: {
     basePath: '/'
   },
+  chainWebpack(config) {
+    config.plugin('windicss').use(WindiCSSPlugin)
+  },
   // Fast Refresh 热更新
   fastRefresh: {}
 })

+ 1 - 1
deploy.config.js

@@ -6,7 +6,7 @@ module.exports = {
     username: 'zongheng',
     password: 'SmartCost#*%)888',
     localPath: 'dist',
-    remotePath: '/mnt/html/cld2/console',
+    remotePath: '/mnt/html/cld2/console_management',
     needEmail: false,
     addressee: '',
     title: '',

+ 1 - 1
package.json

@@ -6,6 +6,7 @@
   "scripts": {
     "analyze": "cross-env ANALYZE=1 umi build",
     "build": "umi build",
+    "deploy:qa": "auto-deploy build -t win",
     "deploy": "npm run site && npm run gh-pages",
     "dev": "npm run start:dev",
     "gh-pages": "gh-pages -d dist",
@@ -52,7 +53,6 @@
     "@ant-design/pro-layout": "^6.15.3",
     "@ant-design/pro-table": "^2.30.8",
     "@icon-park/react": "^1.3.3",
-    "@umijs/openapi": "^1.1.14",
     "@umijs/plugin-openapi": "^1.2.0",
     "@umijs/route-utils": "^1.0.36",
     "ahooks": "^2.10.4",

+ 3 - 2
src/access.ts

@@ -2,13 +2,14 @@
  * @see https://umijs.org/zh-CN/plugins/plugin-access
  * */
 export default function access(initialState: { currentUser?: API.CurrentUser | undefined }) {
-  const { currentUser, roles = [] } = initialState || {}
+  const { currentUser } = initialState || {}
   return {
     authRouteFilter: route => {
       if (currentUser?.isAdmin) {
         return true
       }
-      return roles.includes(route.name)
+
+      return currentUser?.roles.includes(route.name)
     }
   }
 }

+ 12 - 28
src/app.tsx

@@ -2,12 +2,11 @@ import type { Settings as LayoutSettings } from '@ant-design/pro-layout'
 import { PageLoading } from '@ant-design/pro-layout'
 import { notification } from 'antd'
 import type { RequestConfig, RunTimeLayoutConfig } from 'umi'
-import { getIntl, getLocale, history, Link } from 'umi'
+import { getIntl, getLocale, history } from 'umi'
 import RightContent from '@/components/RightContent'
 import Footer from '@/components/Footer'
 import type { RequestOptionsInit, ResponseError } from 'umi-request'
 import { currentUser as queryCurrentUser } from './services/user/api'
-import { BookOutlined, LinkOutlined } from '@ant-design/icons'
 import consts from './utils/consts'
 
 const isDev = process.env.NODE_ENV === 'development'
@@ -25,7 +24,6 @@ export async function getInitialState(): Promise<{
   settings?: Partial<LayoutSettings>
   currentUser?: API.CurrentUser
   menuList?: API.MenuListItem[]
-  roles?: API.Roles
   fetchUserInfo?: () => Promise<API.CurrentUser | undefined>
 }> {
   // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -35,27 +33,15 @@ export async function getInitialState(): Promise<{
     return currentUser
   }
 
-  // // 获取菜单列表id
-  // const fetchMenuList = async () => {
-  //   const menuList = await queryMenuList()
-  //   return menuList
-  // }
-
-  // // 获取用户权限
-  // const fetchRoles = async () => {
-  //   const roles = await queryMenuRole()
-  //   return roles
-  // }
   // 如果是登录页面,不执行
   if (history.location.pathname !== loginPath) {
     try {
-      const currentUser = await fetchUserInfo()
-      // const menuList = await fetchMenuList()
-      // const roles = await fetchRoles()
+      const { data: currentUser } = await fetchUserInfo()
+      console.log('currentUser', currentUser)
+
       return {
         fetchUserInfo,
         menuList: currentUser.menus,
-        roles: currentUser.staff.roles || [],
         currentUser: currentUser.staff,
         settings: {}
       }
@@ -66,8 +52,6 @@ export async function getInitialState(): Promise<{
   }
   return {
     settings: {}
-    // fetchMenuList,
-    // fetchRoles
   }
 }
 
@@ -202,14 +186,14 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => {
     },
     links: isDev
       ? [
-          <Link to="/umi/plugin/openapi" target="_blank">
-            <LinkOutlined />
-            <span>openAPI 文档</span>
-          </Link>,
-          <Link to="/~docs">
-            <BookOutlined />
-            <span>业务组件文档</span>
-          </Link>
+          // <Link to="/umi/plugin/openapi" target="_blank">
+          //   <LinkOutlined />
+          //   <span>openAPI 文档</span>
+          // </Link>,
+          // <Link to="/~docs">
+          //   <BookOutlined />
+          //   <span>业务组件文档</span>
+          // </Link>
         ]
       : [],
     menuHeaderRender: undefined,

+ 0 - 272
src/components/index.md

@@ -1,272 +0,0 @@
----
-title: 业务组件
-sidemenu: false
----
-
-> 此功能由[dumi](https://d.umijs.org/zh-CN/guide/advanced#umi-%E9%A1%B9%E7%9B%AE%E9%9B%86%E6%88%90%E6%A8%A1%E5%BC%8F)提供,dumi 是一个 📖 为组件开发场景而生的文档工具,用过的都说好。
-
-# 业务组件
-
-这里列举了 Pro 中所有用到的组件,这些组件不适合作为组件库,但是在业务中却真实需要。所以我们准备了这个文档,来指导大家是否需要使用这个组件。
-
-## Footer 页脚组件
-
-这个组件自带了一些 Pro 的配置,你一般都需要改掉它的信息。
-
-```tsx
-/**
- * background: '#f0f2f5'
- */
-import React from 'react';
-import Footer from '@/components/Footer';
-
-export default () => <Footer />;
-```
-
-## HeaderDropdown 头部下拉列表
-
-HeaderDropdown 是 antd Dropdown 的封装,但是增加了移动端的特殊处理,用法也是相同的。
-
-```tsx
-/**
- * background: '#f0f2f5'
- */
-import { Button, Menu } from 'antd';
-import React from 'react';
-import HeaderDropdown from '@/components/HeaderDropdown';
-
-export default () => {
-  const menuHeaderDropdown = (
-    <Menu selectedKeys={[]}>
-      <Menu.Item key="center">个人中心</Menu.Item>
-      <Menu.Item key="settings">个人设置</Menu.Item>
-      <Menu.Divider />
-      <Menu.Item key="logout">退出登录</Menu.Item>
-    </Menu>
-  );
-  return (
-    <HeaderDropdown overlay={menuHeaderDropdown}>
-      <Button>hover 展示菜单</Button>
-    </HeaderDropdown>
-  );
-};
-```
-
-## HeaderSearch 头部搜索框
-
-一个带补全数据的输入框,支持收起和展开 Input
-
-```tsx
-/**
- * background: '#f0f2f5'
- */
-import { Button, Menu } from 'antd';
-import React from 'react';
-import HeaderSearch from '@/components/HeaderSearch';
-
-export default () => {
-  return (
-    <HeaderSearch
-      placeholder="站内搜索"
-      defaultValue="umi ui"
-      options={[
-        { label: 'Ant Design Pro', value: 'Ant Design Pro' },
-        {
-          label: 'Ant Design',
-          value: 'Ant Design',
-        },
-        {
-          label: 'Pro Table',
-          value: 'Pro Table',
-        },
-        {
-          label: 'Pro Layout',
-          value: 'Pro Layout',
-        },
-      ]}
-      onSearch={(value) => {
-        console.log('input', value);
-      }}
-    />
-  );
-};
-```
-
-### API
-
-| 参数            | 说明                               | 类型                         | 默认值 |
-| --------------- | ---------------------------------- | ---------------------------- | ------ |
-| value           | 输入框的值                         | `string`                     | -      |
-| onChange        | 值修改后触发                       | `(value?: string) => void`   | -      |
-| onSearch        | 查询后触发                         | `(value?: string) => void`   | -      |
-| options         | 选项菜单的的列表                   | `{label,value}[]`            | -      |
-| defaultVisible  | 输入框默认是否显示,只有第一次生效 | `boolean`                    | -      |
-| visible         | 输入框是否显示                     | `boolean`                    | -      |
-| onVisibleChange | 输入框显示隐藏的回调函数           | `(visible: boolean) => void` | -      |
-
-## NoticeIcon 通知工具
-
-通知工具提供一个展示多种通知信息的界面。
-
-```tsx
-/**
- * background: '#f0f2f5'
- */
-import { message } from 'antd';
-import React from 'react';
-import NoticeIcon from '@/components/NoticeIcon/NoticeIcon';
-
-export default () => {
-  const list = [
-    {
-      id: '000000001',
-      avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
-      title: '你收到了 14 份新周报',
-      datetime: '2017-08-09',
-      type: 'notification',
-    },
-    {
-      id: '000000002',
-      avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png',
-      title: '你推荐的 曲妮妮 已通过第三轮面试',
-      datetime: '2017-08-08',
-      type: 'notification',
-    },
-  ];
-  return (
-    <NoticeIcon
-      count={10}
-      onItemClick={(item) => {
-        message.info(`${item.title} 被点击了`);
-      }}
-      onClear={(title: string, key: string) => message.info('点击了清空更多')}
-      loading={false}
-      clearText="清空"
-      viewMoreText="查看更多"
-      onViewMore={() => message.info('点击了查看更多')}
-      clearClose
-    >
-      <NoticeIcon.Tab
-        tabKey="notification"
-        count={2}
-        list={list}
-        title="通知"
-        emptyText="你已查看所有通知"
-        showViewMore
-      />
-      <NoticeIcon.Tab
-        tabKey="message"
-        count={2}
-        list={list}
-        title="消息"
-        emptyText="您已读完所有消息"
-        showViewMore
-      />
-      <NoticeIcon.Tab
-        tabKey="event"
-        title="待办"
-        emptyText="你已完成所有待办"
-        count={2}
-        list={list}
-        showViewMore
-      />
-    </NoticeIcon>
-  );
-};
-```
-
-### NoticeIcon API
-
-| 参数 | 说明 | 类型 | 默认值 |
-| --- | --- | --- | --- |
-| count | 有多少未读通知 | `number` | - |
-| bell | 铃铛的图表 | `ReactNode` | - |
-| onClear | 点击清空数据按钮 | `(tabName: string, tabKey: string) => void` | - |
-| onItemClick | 未读消息列被点击 | `(item: API.NoticeIconData, tabProps: NoticeIconTabProps) => void` | - |
-| onViewMore | 查看更多的按钮点击 | `(tabProps: NoticeIconTabProps, e: MouseEvent) => void` | - |
-| onTabChange | 通知 Tab 的切换 | `(tabTile: string) => void;` | - |
-| popupVisible | 通知显示是否展示 | `boolean` | - |
-| onPopupVisibleChange | 通知信息显示隐藏的回调函数 | `(visible: boolean) => void` | - |
-| clearText | 清空按钮的文字 | `string` | - |
-| viewMoreText | 查看更多的按钮文字 | `string` | - |
-| clearClose | 展示清空按钮 | `boolean` | - |
-| emptyImage | 列表为空时的兜底展示 | `ReactNode` | - |
-
-### NoticeIcon.Tab API
-
-| 参数         | 说明               | 类型                                 | 默认值 |
-| ------------ | ------------------ | ------------------------------------ | ------ |
-| count        | 有多少未读通知     | `number`                             | -      |
-| title        | 通知 Tab 的标题    | `ReactNode`                          | -      |
-| showClear    | 展示清除按钮       | `boolean`                            | `true` |
-| showViewMore | 展示加载更         | `boolean`                            | `true` |
-| tabKey       | Tab 的唯一 key     | `string`                             | -      |
-| onClick      | 子项的单击事件     | `(item: API.NoticeIconData) => void` | -      |
-| onClear      | 清楚按钮的点击     | `()=>void`                           | -      |
-| emptyText    | 为空的时候测试     | `()=>void`                           | -      |
-| viewMoreText | 查看更多的按钮文字 | `string`                             | -      |
-| onViewMore   | 查看更多的按钮点击 | `( e: MouseEvent) => void`           | -      |
-| list         | 通知信息的列表     | `API.NoticeIconData`                 | -      |
-
-### NoticeIconData
-
-```tsx | pure
-export interface NoticeIconData {
-  id: string;
-  key: string;
-  avatar: string;
-  title: string;
-  datetime: string;
-  type: string;
-  read?: boolean;
-  description: string;
-  clickClose?: boolean;
-  extra: any;
-  status: string;
-}
-```
-
-## RightContent
-
-RightContent 是以上几个组件的组合,同时新增了 plugins 的 `SelectLang` 插件。
-
-```tsx | pure
-<Space>
-  <HeaderSearch
-    placeholder="站内搜索"
-    defaultValue="umi ui"
-    options={[
-      { label: <a href="https://umijs.org/zh/guide/umi-ui.html">umi ui</a>, value: 'umi ui' },
-      {
-        label: <a href="next.ant.design">Ant Design</a>,
-        value: 'Ant Design',
-      },
-      {
-        label: <a href="https://protable.ant.design/">Pro Table</a>,
-        value: 'Pro Table',
-      },
-      {
-        label: <a href="https://prolayout.ant.design/">Pro Layout</a>,
-        value: 'Pro Layout',
-      },
-    ]}
-  />
-  <Tooltip title="使用文档">
-    <span
-      className={styles.action}
-      onClick={() => {
-        window.location.href = 'https://pro.ant.design/docs/getting-started';
-      }}
-    >
-      <QuestionCircleOutlined />
-    </span>
-  </Tooltip>
-  <Avatar />
-  {REACT_APP_ENV && (
-    <span>
-      <Tag color={ENVTagColor[REACT_APP_ENV]}>{REACT_APP_ENV}</Tag>
-    </span>
-  )}
-  <SelectLang className={styles.action} />
-</Space>
-```

+ 67 - 108
src/pages/Role/Customer/index.tsx

@@ -84,8 +84,6 @@ const Customer = () => {
     manual: true,
     onSuccess: (result: API.GetRolePermissionResultModel) => {
       const values = { ...formatPermission('init', result.permission) }
-      console.log('values', values)
-
       formRef.current?.setFieldsValue(values)
     }
   })
@@ -120,114 +118,75 @@ const Customer = () => {
               />
             </TabPane>
             <TabPane tab="角色权限" key="2">
-              {state.id && (
-                <ProForm
-                  formRef={formRef}
-                  layout="horizontal"
-                  onFinish={async values => {
-                    const newValues = formatPermission('submit', values)
-                    await updateRolePermission({
-                      permission: JSON.stringify(newValues),
-                      id: state.id
-                    })
-                    message.success('设置成功')
-                  }}>
-                  {/* <ProFormSwitch
-                  name="showHome"
-                  label={
-                    <span className="flex items-center">
-                      <Icon type="home" className="mr-1" className="flex items-baseline mr-1" />
-                      后台首页
-                    </span>
-                  }
-                /> */}
-
-                  <ProFormSwitch
-                    name="showSystem"
-                    label={
-                      <span className="flex items-center">
-                        <Icon
-                          type="every-user"
-                          className="mr-1"
-                          className="flex items-baseline mr-1"
-                        />
-                        角色权限管理
-                      </span>
-                    }
-                  />
-                  <ProFormDependency name={['showSystem']}>
-                    {({ showSystem }) => (
-                      <ProFormCheckbox.Group
-                        wrapperCol={{ offset: 1 }}
-                        // initialValue={}
-                        name="system"
-                        options={[
-                          { value: 'system', label: '系统管理', disabled: !showSystem },
-                          { value: 'customer', label: '客户', disabled: !showSystem }
-                          // { value: '3', label: '产品', disabled: !showAuth },
-                          // { value: '4', label: '开票合同', disabled: !showAuth },
-                          // { value: '5', label: '考勤', disabled: !showAuth },
-                          // { value: '6', label: '人资', disabled: !showAuth },
-                          // { value: '7', label: '财务费用', disabled: !showAuth }
-                        ]}
-                      />
-                    )}
-                  </ProFormDependency>
-                  {/* <ProFormSwitch
-                  name="showAudit"
-                  label={
-                    <span className="flex items-center">
-                      <Icon
-                        type="inspection"
-                        className="mr-1"
-                        className="flex items-baseline mr-1"
-                      />
-                      审批流程
-                    </span>
-                  }
-                />
-                <ProFormDependency name={['showAudit']}>
-                  {({ showAudit }) => (
-                    <ProFormCheckbox.Group
-                      wrapperCol={{ offset: 1 }}
-                      name="audit"
-                      options={[
-                        { value: '1', label: '流程角色', disabled: !showAudit },
-                        { value: '2', label: '开票合同', disabled: !showAudit },
-                        { value: '3', label: '财务费用', disabled: !showAudit },
-                        { value: '4', label: '人资管理', disabled: !showAudit },
-                        { value: '5', label: '考勤', disabled: !showAudit }
-                      ]}
+              <div className="ml-4">
+                {state.id && (
+                  <ProForm
+                    formRef={formRef}
+                    layout="horizontal"
+                    onFinish={async values => {
+                      const newValues = formatPermission('submit', values)
+                      await updateRolePermission({
+                        permission: JSON.stringify(newValues),
+                        id: state.id
+                      })
+                      message.success('设置成功')
+                    }}>
+                    <ProFormSwitch
+                      name="showClient"
+                      label={
+                        <span className="flex items-center">
+                          <Icon
+                            type="every-user"
+                            className="mr-1"
+                            className="flex items-baseline mr-1"
+                          />
+                          联系人
+                        </span>
+                      }
                     />
-                  )}
-                </ProFormDependency>
-                <ProFormSwitch
-                  name="reset"
-                  label={
-                    <span className="flex items-center">
-                      <Icon
-                        type="association"
-                        className="mr-1"
-                        className="flex items-baseline mr-1"
-                      />
-                      业务参数
-                    </span>
-                  }
-                />
-                <ProFormDependency name={['reset']}>
-                  {({ reset }) => (
-                    <ProFormCheckbox.Group
-                      wrapperCol={{ offset: 1 }}
-                      name="audit"
-                      options={[
-                        { value: '1', label: '客户', disabled: !reset },
-                        { value: '2', label: '产品', disabled: !reset }
-                      ]}
+                    <ProFormDependency name={['showClient']}>
+                      {({ showClient }) => (
+                        <ProFormCheckbox.Group
+                          wrapperCol={{ offset: 1 }}
+                          name="client"
+                          options={[
+                            { value: 'access', label: '查看', disabled: !showClient },
+                            { value: 'add', label: '添加联系人', disabled: !showClient },
+                            { value: 'delete', label: '删除联系人', disabled: !showClient }
+                          ]}
+                        />
+                      )}
+                    </ProFormDependency>
+                    <ProFormSwitch
+                      name="showCompany"
+                      label={
+                        <span className="flex items-center">
+                          <Icon
+                            type="every-user"
+                            className="mr-1"
+                            className="flex items-baseline mr-1"
+                          />
+                          客户
+                        </span>
+                      }
                     />
-                  )}
-                </ProFormDependency> */}
-                </ProForm>
-              )}
+                    <ProFormDependency name={['showCompany']}>
+                      {({ showCompany }) => (
+                        <ProFormCheckbox.Group
+                          wrapperCol={{ offset: 1 }}
+                          // initialValue={}
+                          name="company"
+                          options={[
+                            { value: 'access', label: '查看', disabled: !showCompany },
+                            { value: 'add', label: '添加客户', disabled: !showCompany },
+                            { value: 'delete', label: '删除客户', disabled: !showCompany }
+                          ]}
+                        />
+                      )}
+                    </ProFormDependency>
+                  </ProForm>
+                )}
+              </div>
             </TabPane>
           </Tabs>
         </div>

+ 2 - 2
src/pages/Role/System/components/ConnectModal/index.tsx

@@ -91,7 +91,7 @@ const ConnectModal: React.FC<ConnectModalProps> = ({ title, dataId, onSelect })
         }>
         <div ref={containerRef} className="h-60vh overflow-y-auto overflow-x-hidden modal-content">
           {list.map(item => (
-            <div className="card" key={item.staffId}>
+            <div className="card" key={item.id}>
               <div className="w-4/3 flex justify-between">
                 <span className="w-1/5">{item.username}</span>
                 <span className="w-2/5">{item.phone}</span>
@@ -99,7 +99,7 @@ const ConnectModal: React.FC<ConnectModalProps> = ({ title, dataId, onSelect })
                 <span className="w-1/5">{item.category}</span>
               </div>
               <div className="w-1/4 flex justify-end">
-                <span className="btn-outline" onClick={() => itemSelectHandler(item.staffId)}>
+                <span className="btn-outline" onClick={() => itemSelectHandler(item.id)}>
                   选择ta
                 </span>
               </div>

+ 48 - 46
src/pages/Role/System/index.tsx

@@ -120,19 +120,20 @@ const System = () => {
               />
             </TabPane>
             <TabPane tab="角色权限" key="2">
-              {state.id && (
-                <ProForm
-                  layout="horizontal"
-                  formRef={formRef}
-                  onFinish={async values => {
-                    const newValues = formatPermission('submit', values)
-                    await updateRolePermission({
-                      permission: JSON.stringify(newValues),
-                      id: state.id
-                    })
-                    message.success('设置成功')
-                  }}>
-                  {/* <ProFormSwitch
+              <div className="ml-4">
+                {state.id && (
+                  <ProForm
+                    layout="horizontal"
+                    formRef={formRef}
+                    onFinish={async values => {
+                      const newValues = formatPermission('submit', values)
+                      await updateRolePermission({
+                        permission: JSON.stringify(newValues),
+                        id: state.id
+                      })
+                      message.success('设置成功')
+                    }}>
+                    {/* <ProFormSwitch
                   name="showHome"
                   label={
                     <span className="flex items-center">
@@ -142,38 +143,38 @@ const System = () => {
                   }
                 /> */}
 
-                  <ProFormSwitch
-                    name="showSystem"
-                    label={
-                      <span className="flex items-center">
-                        <Icon
-                          type="every-user"
-                          className="mr-1"
-                          className="flex items-baseline mr-1"
+                    <ProFormSwitch
+                      name="showSystem"
+                      label={
+                        <span className="flex items-center">
+                          <Icon
+                            type="every-user"
+                            className="mr-1"
+                            className="flex items-baseline mr-1"
+                          />
+                          角色权限管理
+                        </span>
+                      }
+                    />
+                    <ProFormDependency name={['showSystem']}>
+                      {({ showSystem }) => (
+                        <ProFormCheckbox.Group
+                          wrapperCol={{ offset: 1 }}
+                          // initialValue={}
+                          name="system"
+                          options={[
+                            { value: 'system', label: '系统管理', disabled: !showSystem },
+                            { value: 'customer', label: '客户', disabled: !showSystem }
+                            // { value: '3', label: '产品', disabled: !showAuth },
+                            // { value: '4', label: '开票合同', disabled: !showAuth },
+                            // { value: '5', label: '考勤', disabled: !showAuth },
+                            // { value: '6', label: '人资', disabled: !showAuth },
+                            // { value: '7', label: '财务费用', disabled: !showAuth }
+                          ]}
                         />
-                        角色权限管理
-                      </span>
-                    }
-                  />
-                  <ProFormDependency name={['showSystem']}>
-                    {({ showSystem }) => (
-                      <ProFormCheckbox.Group
-                        wrapperCol={{ offset: 1 }}
-                        // initialValue={}
-                        name="system"
-                        options={[
-                          { value: 'system', label: '系统管理', disabled: !showSystem },
-                          { value: 'customer', label: '客户', disabled: !showSystem }
-                          // { value: '3', label: '产品', disabled: !showAuth },
-                          // { value: '4', label: '开票合同', disabled: !showAuth },
-                          // { value: '5', label: '考勤', disabled: !showAuth },
-                          // { value: '6', label: '人资', disabled: !showAuth },
-                          // { value: '7', label: '财务费用', disabled: !showAuth }
-                        ]}
-                      />
-                    )}
-                  </ProFormDependency>
-                  {/* <ProFormSwitch
+                      )}
+                    </ProFormDependency>
+                    {/* <ProFormSwitch
                   name="showAudit"
                   label={
                     <span className="flex items-center">
@@ -226,8 +227,9 @@ const System = () => {
                     />
                   )}
                 </ProFormDependency> */}
-                </ProForm>
-              )}
+                  </ProForm>
+                )}
+              </div>
             </TabPane>
           </Tabs>
         </div>

+ 2 - 3
src/services/user/api.ts

@@ -91,9 +91,8 @@ export async function getRolePermissions(params: { id: string }) {
 
 /** 获取员工列表 */
 export async function fetchStaffList(params: API.GetStaffListParams) {
-  return request<API.StaffItem[]>('/api/staff/list', {
-    params,
-    prefix: ''
+  return request<API.StaffItem[]>('/role/staff/all', {
+    params
   })
 }
 

+ 1 - 1
src/services/user/typings.d.ts

@@ -116,7 +116,7 @@ declare namespace API {
   } & PageParams
 
   type StaffItem = {
-    staffId: string
+    id: string
     categoryId: string
     departmentId: string
     positionId: string

+ 0 - 1
src/utils/utils.ts

@@ -28,7 +28,6 @@ export const formatPermission = (type: 'init' | 'submit', values: any) => {
       if (Object.prototype.hasOwnProperty.call(newValues, key)) {
         if (newValues[key]?.length) {
           newValues[`show${key.replace(key[0], key[0].toUpperCase())}`] = true
-          console.log(`show${key.replace(key[0], key[0].toUpperCase())}`)
         }
       }
     }