Browse Source

fix: 取消部门列表操作 修正部门名称接口字段

xyh 3 years ago
parent
commit
6ac5a3b521

+ 4 - 0
packages/app/public/index.html

@@ -6,6 +6,10 @@
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
+  <meta name="renderer" content="webkit" />
+  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+  <meta http-equiv="Pragma" content="no-cache" />
+  <meta http-equiv="Cache-Control" content="no-cache" />
   <title>
     <%= htmlWebpackPlugin.options.title %>
   </title>

BIN
packages/app/src/assets/images/logo.png


+ 1 - 1
packages/app/src/hooks/useOptions/index.ts

@@ -34,7 +34,7 @@ function useQueryOptions<T extends {id: number | string}>(
 export function useDepartmentOptions(addAll = false) {
   return useQueryOptions(
     getAllDepartment,
-    state => state.departmentName,
+    state => state.name,
     addAll,
   );
 }

+ 1 - 1
packages/app/src/models/request/department.ts

@@ -5,7 +5,7 @@ export type GetDepartmentListParams = {
   /** 部门编号 */
   code: string;
   /** 部门名称 */
-  departmentName: string;
+  name: string;
 } & ListParams;
 
 /** 导出部门参数 */

+ 1 - 1
packages/app/src/models/response/department.ts

@@ -4,7 +4,7 @@ export type DepartmentListData = {
   /** 部门编号 */
   code: string,
   /** 部门名称 */
-  departmentName: string,
+  name: string,
   /** 创建时间 */
   createTime: string
 };

+ 1 - 1
packages/app/src/pages/department/filter/hooks.ts

@@ -35,7 +35,7 @@ export function useExport() {
       page: page.toString(),
       limit: pageSize.toString(),
       code,
-      departmentName: name,
+      name,
     });
   }
 

+ 1 - 1
packages/app/src/pages/department/table/hooks.tsx

@@ -14,7 +14,7 @@ export function useList() {
     context,
     function([{name, code}]) {
       return {
-        departmentName: name,
+        name,
         code,
       };
     },

+ 14 - 7
packages/app/src/pages/department/table/index.tsx

@@ -4,21 +4,28 @@ import {useHandle, useList} from './hooks';
 import Modal from './modal';
 import {Table, TableTools} from '@components';
 import {pageContext, searchContext} from '../context';
+import {DepartmentListData} from '@models';
+import {ColumnsType} from 'antd/es/table';
+
+const columns: ColumnsType<DepartmentListData> = [
+  {title: '部门编号', dataIndex: 'code', key: 'code'},
+  {title: '部门名称', dataIndex: 'name', key: 'name', width: '45%'},
+  {title: '创建时间', dataIndex: 'createTime', key: 'createTime'},
+];
 
 const TableList: FC = function() {
   const [
     {count, data},
-    {refetch},
   ] = useList();
-  const [
-    {modalVisible, columns, editState},
-    {onAdd, setFalse},
-  ] = useHandle(refetch);
+  // const [
+  //   {modalVisible, columns, editState},
+  //   {onAdd, setFalse},
+  // ] = useHandle(refetch);
 
   return (
     <>
       <Card className='table-wrapper'>
-        <TableTools onClick={onAdd} />
+        {/* <TableTools onClick={onAdd} /> */}
 
         <Table
           data-testid='department_table'
@@ -30,7 +37,7 @@ const TableList: FC = function() {
         />
       </Card>
 
-      <Modal visible={modalVisible} onClose={setFalse} onFetch={refetch} id={editState} />
+      {/* <Modal visible={modalVisible} onClose={setFalse} onFetch={refetch} id={editState} /> */}
     </>
   );
 };

+ 1 - 1
packages/app/src/pages/department/table/modal/hooks.ts

@@ -97,6 +97,6 @@ export function useFormValues(id: string) {
   });
 
   useEffect(function() {
-    setValue('departmentName', data?.departmentName ?? '');
+    setValue('departmentName', data?.name ?? '');
   }, [data, setValue]);
 }

+ 11 - 1
packages/app/src/pages/main/index.tsx

@@ -6,7 +6,17 @@ const Main: FC = function() {
   return (
     <section className={css.main}>
       <Card>
-        <p>main</p>
+        <section
+          style={{
+            width: '100%',
+            height: '500px',
+            display: 'flex',
+            alignItems: 'center',
+            justifyContent: 'center',
+          }}
+        >
+          <h1 style={{fontSize: '40px'}}>仓储物流管理系统</h1>
+        </section>
       </Card>
     </section>
   );

+ 3 - 1
packages/app/src/utils/constants.ts

@@ -3,7 +3,9 @@ export const USER_TOKEN_STORAGE = 'user_token';
 /** 页码列表 */
 export const PAGE_SIZE_LIST = ['10', '30', '50', '80', '100'];
 /** 请求域名 */
-export const NETWORK_URL = 'http://192.168.0.118:9560';
+export const NETWORK_URL = process.env.NODE_ENV === 'development'
+  ? 'http://192.168.0.118:9560'
+  : 'http://8.142.144.205:9560';
 export const E2E_NETWORK_URL = 'http://e2e.test.cn';
 /** 导出错误提示 */
 export const EXPORT_ERROR_TIPS = '导出错误,请稍后再试';