Explorar el Código

fix(notice): notice log

lind hace 3 años
padre
commit
28eb18201f

+ 1 - 1
src/pages/notice/Config/index.tsx

@@ -310,7 +310,7 @@ const Config = observer(() => {
         )}
       />
       <Debug />
-      <Log />
+      {state.log && <Log />}
     </PageContainer>
   );
 });

+ 1 - 1
src/pages/notice/Template/Log/index.tsx

@@ -56,7 +56,7 @@ const Log = observer(() => {
       onCancel={() => (state.log = false)}
       title="通知记录"
       width={'70vw'}
-      visible={state.log}
+      visible={state.log && !!state.current?.id}
     >
       <SearchComponent
         defaultParam={[{ column: 'notifyType$IN', value: id }]}

+ 5 - 3
src/pages/notice/Template/index.tsx

@@ -23,6 +23,7 @@ import { downloadObject } from '@/utils/util';
 import moment from 'moment';
 import { ProTableCard } from '@/components';
 import NoticeCard, { typeList } from '@/components/ProTableCard/CardItems/noticeTemplate';
+import { observer } from '@formily/react';
 
 export const service = new Service('notifier/template');
 
@@ -35,7 +36,7 @@ export const state = model<{
   debug: false,
   log: false,
 });
-const Template = () => {
+const Template = observer(() => {
   const intl = useIntl();
   const location = useLocation<{ id: string }>();
   const id = (location as any).query?.id;
@@ -262,6 +263,7 @@ const Template = () => {
                 key="log"
                 onClick={() => {
                   state.log = true;
+                  state.current = record;
                 }}
               >
                 <UnorderedListOutlined />
@@ -287,8 +289,8 @@ const Template = () => {
         }
       />
       <Debug />
-      <Log />
+      {state.log && <Log />}
     </PageContainer>
   );
-};
+});
 export default Template;