Explorar o código

fix: 容器管理部门管理使用公共字典

xyh %!s(int64=2) %!d(string=hai) anos
pai
achega
35ab2dbf74

+ 2 - 1
.gitignore

@@ -4,4 +4,5 @@ build
 analyzer
 coverage
 .swc
-cypress/videos
+cypress/videos
+cypress/screenshots

+ 2 - 0
cypress/e2e/container.cy.ts

@@ -17,6 +17,7 @@ import {
   tableBtnClick,
   validateModalOperation,
   closeModal,
+  dictionaryIntercept,
 } from './utils';
 
 describe('容器管理', function() {
@@ -25,6 +26,7 @@ describe('容器管理', function() {
     menuIntercept();
     loginSetup();
     optionsIntercept();
+    dictionaryIntercept();
     menuTrigger(2, 2);
   });
 

+ 2 - 2
packages/app/src/pages/container/filter/index.tsx

@@ -2,7 +2,7 @@ import {FilterButtonGroup, FilterField, FilterSelect} from '@components';
 import {Card, Row} from 'antd';
 import {FC} from 'react';
 import {useExport, useSearch} from './hooks';
-import {useDepartmentOptions, useFilterField, useTableSearch} from '@hooks';
+import {useDictionaryOptions, useFilterField, useTableSearch} from '@hooks';
 import {searchContext} from '../context';
 
 const Filter: FC = function() {
@@ -11,7 +11,7 @@ const Filter: FC = function() {
     type: '',
     name: '',
   });
-  const options = useDepartmentOptions(true);
+  const options = useDictionaryOptions('部门字典', true);
   const onSearch = useSearch({name, department, type});
   const [isSearching] = useTableSearch(searchContext);
   const [isExporting, onExport] = useExport();

+ 2 - 2
packages/app/src/pages/container/table/put-modal/Info.tsx

@@ -1,7 +1,7 @@
 import {FC} from 'react';
 import {useControl, useWatchId} from './hooks';
 import {ModalField, ModalSelect} from '@components';
-import {useDepartmentOptions} from '@hooks';
+import {useDictionaryOptions} from '@hooks';
 
 type Props = {
   id: string
@@ -9,7 +9,7 @@ type Props = {
 
 const Info: FC<Props> = function({id}) {
   const control = useControl();
-  const options = useDepartmentOptions();
+  const options = useDictionaryOptions('部门字典');
   useWatchId(id);
 
   return (