xieyonghong 3 lat temu
rodzic
commit
c178577711
36 zmienionych plików z 378 dodań i 294 usunięć
  1. 5 5
      src/components/BaseCrud/index.tsx
  2. 2 0
      src/components/CheckButton/index.less
  3. 1 0
      src/components/CheckButton/index.tsx
  4. 1 3
      src/components/FRuleEditor/Editor/index.tsx
  5. 4 1
      src/components/FRuleEditor/index.tsx
  6. 1 1
      src/components/SearchComponent/GroupNameControl.tsx
  7. 56 18
      src/components/SearchComponent/index.less
  8. 158 141
      src/components/SearchComponent/index.tsx
  9. 19 0
      src/components/SearchComponent/readme.md
  10. 7 6
      src/pages/device/Instance/Detail/ChildDevice/BindChildDevice/index.tsx
  11. 7 6
      src/pages/device/Instance/Detail/ChildDevice/index.tsx
  12. 7 6
      src/pages/device/Instance/Detail/Log/index.tsx
  13. 7 6
      src/pages/device/Instance/Detail/Running/Event/index.tsx
  14. 5 5
      src/pages/device/Instance/index.tsx
  15. 5 4
      src/pages/device/Product/Detail/Access/AccessConfig/index.tsx
  16. 5 5
      src/pages/device/Product/index.tsx
  17. 5 4
      src/pages/link/AccessConfig/index.tsx
  18. 0 1
      src/pages/link/Type/Detail/index.tsx
  19. 7 6
      src/pages/system/Department/Assets/deivce/bind.tsx
  20. 5 5
      src/pages/system/Department/Assets/deivce/index.tsx
  21. 7 6
      src/pages/system/Department/Assets/product/bind.tsx
  22. 5 5
      src/pages/system/Department/Assets/product/index.tsx
  23. 7 6
      src/pages/system/Department/Assets/productCategory/bind.tsx
  24. 5 5
      src/pages/system/Department/Assets/productCategory/index.tsx
  25. 7 6
      src/pages/system/Department/Member/bind.tsx
  26. 5 5
      src/pages/system/Department/Member/index.tsx
  27. 6 6
      src/pages/system/Department/index.tsx
  28. 2 2
      src/pages/system/Department/save.tsx
  29. 1 1
      src/pages/system/Menu/Detail/edit.tsx
  30. 6 5
      src/pages/system/Menu/index.tsx
  31. 1 1
      src/pages/system/Permission/Save/index.tsx
  32. 6 6
      src/pages/system/Permission/index.tsx
  33. 7 6
      src/pages/system/Role/Detail/UserManage/BindUser.tsx
  34. 5 5
      src/pages/system/Role/Detail/UserManage/index.tsx
  35. 0 5
      src/pages/system/User/index.tsx
  36. 1 1
      src/utils/menu/index.ts

+ 5 - 5
src/components/BaseCrud/index.tsx

@@ -83,11 +83,11 @@ const BaseCrud = <T extends Record<string, any>>(props: Props<T>) => {
           setParam(data);
         }}
         target={moduleName}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setParam({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setParam({});
+        // }}
       />
       <ProTable<T>
         params={param}

+ 2 - 0
src/components/CheckButton/index.less

@@ -2,6 +2,7 @@
 
 .box {
   display: flex;
+
   .item {
     color: rgba(0, 0, 0, 0.75);
     font-size: 16px;
@@ -10,6 +11,7 @@
     &.active {
       color: @primary-color-active;
     }
+
     &:hover {
       color: @primary-color-hover;
     }

+ 1 - 0
src/components/CheckButton/index.tsx

@@ -1,6 +1,7 @@
 import { AppstoreOutlined, BarsOutlined } from '@ant-design/icons';
 import classnames from 'classnames';
 import './index.less';
+
 interface Props {
   value: boolean;
   change: (value: boolean) => void;

+ 1 - 3
src/components/FRuleEditor/Editor/index.tsx

@@ -109,6 +109,7 @@ const Editor = (props: Props) => {
         text: value,
       },
     ]);
+    Store.set('add-operator-value', undefined);
   };
 
   useEffect(() => {
@@ -116,9 +117,6 @@ const Editor = (props: Props) => {
     return () => subscription.unsubscribe();
   }, [props.mode]);
 
-  useEffect(() => {
-    Store.set('add-operator-value', undefined);
-  }, []);
   return (
     <div className={styles.box}>
       <div className={styles.top}>

+ 4 - 1
src/components/FRuleEditor/index.tsx

@@ -31,7 +31,10 @@ const FRuleEditor = observer((props: Props) => {
     State.property = property;
     const subscription = Store.subscribe('rule-editor-value', onChange);
     State.code = value;
-    return () => subscription.unsubscribe();
+    return () => {
+      subscription.unsubscribe();
+      State.code = '';
+    };
   });
   return (
     <>

+ 1 - 1
src/components/SearchComponent/GroupNameControl.tsx

@@ -12,7 +12,7 @@ const GroupNameControl = (props: Props) => {
   return (
     <>
       {index === 0 ? (
-        <div style={{ textAlign: 'center', fontWeight: 600 }}>{props?.name || '第一组'}</div>
+        <div style={{ fontWeight: 600 }}>{props?.name || '第一组'}</div>
       ) : (
         <Select
           onChange={props.onChange}

+ 56 - 18
src/components/SearchComponent/index.less

@@ -1,27 +1,65 @@
-.action {
-  display: flex;
-  align-items: center;
-}
+.container {
+  margin-bottom: 20px;
+  border-bottom: 1px solid #f0f0f0;
+
+  .action {
+    position: relative;
+    display: flex;
+    justify-content: center;
+
+    .more {
+      position: absolute;
+      top: 0;
+    }
 
-.simple {
-  display: flex;
-  flex-direction: row;
+    .simple {
+      right: 0;
+    }
+
+    .advance {
+      right: -150px;
+    }
 
-  :global {
-    .ant-formily-grid-layout {
-      width: 550px;
-      height: 40px;
+    :global {
+      .ant-space-align-center {
+        align-items: normal;
+      }
     }
   }
-}
 
-.history {
-  width: 176px;
-  .list {
+  .form {
+    :global {
+      .ant-formily-item {
+        margin-bottom: 12px;
+      }
+    }
+  }
+
+  .simple {
     display: flex;
-    align-items: center;
-    justify-content: space-between;
-    width: 148px;
+    flex-direction: row;
+
+    :global {
+      .ant-formily-grid-layout {
+        width: 550px;
+        height: 40px;
+      }
+
+      .ant-formily-item {
+        margin-bottom: 0;
+      }
+    }
+  }
+
+  .history {
+    width: 176px;
+
+    .list {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      width: 148px;
+    }
   }
 }
 

+ 158 - 141
src/components/SearchComponent/index.tsx

@@ -4,7 +4,6 @@ import {
   ArrayItems,
   DatePicker,
   Form,
-  FormButtonGroup,
   FormGrid,
   FormItem,
   FormTab,
@@ -17,7 +16,13 @@ import {
 import type { Field, FieldDataSource } from '@formily/core';
 import { createForm, onFieldReact } from '@formily/core';
 import GroupNameControl from '@/components/SearchComponent/GroupNameControl';
-import { DeleteOutlined, DoubleRightOutlined } from '@ant-design/icons';
+import {
+  DeleteOutlined,
+  DoubleRightOutlined,
+  ReloadOutlined,
+  SaveOutlined,
+  SearchOutlined,
+} from '@ant-design/icons';
 import {
   Button,
   Card,
@@ -36,6 +41,7 @@ import styles from './index.less';
 import Service from '@/components/SearchComponent/service';
 import _ from 'lodash';
 import { useIntl } from '@@/plugin-locale/localeExports';
+import classnames from 'classnames';
 
 const ui2Server = (source: SearchTermsUI): SearchTermsServer => [
   { terms: source.terms1 },
@@ -53,10 +59,21 @@ interface Props<T> {
   field: ProColumns<T>[];
   onSearch: (params: { terms: SearchTermsServer }) => void;
   target?: string;
-  onReset?: () => void;
-  /** @name 固定查询参数*/
-  defaultParam?: Term[] | any;
-  pattern?: 'simple' | 'advance';
+  /**
+   *  @name 固定查询参数
+   *  eg: 1: {[{ column: 'test', value: 'admin' }]}
+   *      2: {[
+   *            {
+   *              terms: [{ column: 'parentId$isnull', value: '' }, { column: 'parentId$not', value: 'test', type: 'or' }],
+   *            },
+   *            {
+   *              terms: [{ column: 'id$not', value: 'test', type: 'and' }],
+   *            },
+   *         ]}
+   * */
+  defaultParam?: SearchTermsServer | Term[];
+  // pattern?: 'simple' | 'advance';
+  enableSave?: boolean;
 }
 
 const termType = [
@@ -91,20 +108,10 @@ const SchemaField = createSchemaField({
 });
 
 const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
-  const { field, target, onReset, onSearch, defaultParam, pattern = 'advance' } = props;
+  const { field, target, onSearch, defaultParam, enableSave = true } = props;
   const intl = useIntl();
   const [expand, setExpand] = useState<boolean>(true);
-  const initForm = server2Ui(
-    pattern === 'advance'
-      ? [
-          {
-            terms: [initTerm],
-            type: 'and',
-          },
-          { terms: [initTerm] },
-        ]
-      : [{ terms: [initTerm] }],
-  );
+  const initForm = server2Ui([{ terms: [initTerm] }]);
   const [logVisible, setLogVisible] = useState<boolean>(false);
   const [aliasVisible, setAliasVisible] = useState<boolean>(false);
   const [initParams, setInitParams] = useState<SearchTermsUI>(initForm);
@@ -173,19 +180,6 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
     }
   };
 
-  const handleExpand = () => {
-    const value = form.values;
-    if (!expand) {
-      value.terms1.splice(1, 2);
-      value.terms2.splice(1, 2);
-    } else {
-      value.terms2.push(initTerm, initTerm);
-      value.terms1.push(initTerm, initTerm);
-    }
-    setInitParams(value);
-    setExpand(!expand);
-  };
-
   const filterSearchTerm = (): EnumData[] =>
     field
       .filter((item) => item.dataIndex)
@@ -205,27 +199,30 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
       type: 'object',
       'x-component': 'FormGrid',
       'x-component-props': {
-        minColumns: 6,
-        maxColumns: 6,
+        minColumns: 14,
+        maxColumns: 14,
+        columnGap: 24,
+        // rowGap: 1,
       },
       properties: {
         type: {
           'x-decorator': 'FormItem',
           'x-component': 'GroupNameControl',
           'x-decorator-props': {
-            gridSpan: 1,
+            gridSpan: 2,
           },
+          default: 'or',
           'x-component-props': {
             name: name,
           },
-          'x-visible': pattern === 'advance',
+          'x-visible': !expand,
         },
         column: {
           type: 'string',
           'x-decorator': 'FormItem',
           'x-component': 'Select',
           'x-decorator-props': {
-            gridSpan: 2,
+            gridSpan: 3,
           },
           'x-component-props': {
             placeholder: '请选择',
@@ -237,14 +234,14 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
           'x-decorator': 'FormItem',
           'x-component': 'Select',
           'x-decorator-props': {
-            gridSpan: 1,
+            gridSpan: 3,
           },
           default: 'like',
           enum: termType,
         },
         value: {
           'x-decorator-props': {
-            gridSpan: 2,
+            gridSpan: 6,
           },
           'x-decorator': 'FormItem',
           'x-component': 'Input',
@@ -289,6 +286,19 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
     },
   };
 
+  const handleExpand = () => {
+    const value = form.values;
+    if (expand) {
+      value.terms1.push(initTerm, initTerm);
+      value.terms2?.push(initTerm, initTerm, initTerm);
+    } else {
+      value.terms1.splice(1, 2);
+      value.terms2 = [];
+    }
+    setInitParams(value);
+    setExpand(!expand);
+  };
+
   const simpleSchema: ISchema = {
     type: 'object',
     properties: {
@@ -342,17 +352,32 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
     </Menu>
   );
 
-  const formatValue = (value: SearchTermsUI): SearchTermsServer =>
-    ui2Server(value).map((term) => {
-      term.terms?.map((item) => {
-        if (item.termType === 'like') {
-          item.value = `%${item.value}%`;
+  const formatValue = (value: SearchTermsUI): SearchTermsServer => {
+    let _value = ui2Server(value);
+
+    // 处理默认查询参数
+    if (defaultParam && defaultParam?.length > 0) {
+      if ('terms' in defaultParam[0]) {
+        console.log(defaultParam, 'terms');
+        _value = _value.concat(defaultParam as SearchTermsServer);
+      } else if ('value' in defaultParam[0]) {
+        console.log(defaultParam, 'value');
+        _value = _value.concat([{ terms: defaultParam }]);
+      }
+    }
+    return _value
+      .filter((i) => i.terms?.length > 0)
+      .map((term) => {
+        term.terms?.map((item) => {
+          if (item.termType === 'like') {
+            item.value = `%${item.value}%`;
+            return item;
+          }
           return item;
-        }
-        return item;
+        });
+        return term;
       });
-      return term;
-    });
+  };
 
   const handleSearch = async () => {
     const value = form.values;
@@ -361,9 +386,7 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
     const _terms = _.cloneDeep(value);
     _terms.terms1 = filterTerms(_terms.terms1);
     _terms.terms2 = filterTerms(_terms.terms2);
-    if (defaultParam) {
-      _terms.terms1 = _terms.terms1.concat(defaultParam);
-    }
+
     onSearch({ terms: formatValue(_terms) });
   };
 
@@ -393,104 +416,98 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
     const expandData = Array(expand ? 1 : 3).fill(initTerm);
     temp.terms1 = expandData;
     temp.terms2 = expandData;
-    // setInitParams(temp);
     await form.reset();
-    onReset?.();
+    await handleSearch();
   };
 
-  const renderAdvance = () => {
-    return (
-      <>
-        <SchemaField schema={schema} />
-        <div className={styles.action}>
-          <FormButtonGroup.FormItem labelCol={10} wrapperCol={14}>
-            <Dropdown.Button
-              placement={'bottomLeft'}
-              trigger={['click']}
-              onClick={handleSearch}
-              visible={logVisible}
-              onVisibleChange={async (visible) => {
-                setLogVisible(visible);
-                if (visible) {
-                  await queryHistory();
-                }
-              }}
-              type="primary"
-              overlay={historyDom}
-            >
-              搜索
-            </Dropdown.Button>
-            <Popover
-              content={
-                <Form style={{ width: '217px' }} form={historyForm}>
-                  <SchemaField
-                    schema={{
-                      type: 'object',
-                      properties: {
-                        alias: {
-                          'x-decorator': 'FormItem',
-                          'x-component': 'Input.TextArea',
-                          'x-validator': [
-                            {
-                              max: 50,
-                              message: '最多可输入50个字符',
-                            },
-                          ],
-                        },
-                      },
-                    }}
-                  />
-                  <Button onClick={handleSaveLog} type="primary" className={styles.saveLog}>
-                    保存
-                  </Button>
-                </Form>
-              }
-              visible={aliasVisible}
-              onVisibleChange={setAliasVisible}
-              title="搜索名称"
-              trigger="click"
-            >
-              <Button block>
-                {intl.formatMessage({
-                  id: 'pages.data.option.save',
-                  defaultMessage: '保存',
-                })}
-              </Button>
-            </Popover>
-            <Button block onClick={resetForm}>
-              重置
-            </Button>
-          </FormButtonGroup.FormItem>
-          <div>
-            <DoubleRightOutlined
-              onClick={handleExpand}
-              style={{ fontSize: 20 }}
-              rotate={expand ? 90 : -90}
-            />
-          </div>
-        </div>
-      </>
-    );
+  const SearchBtn = {
+    simple: (
+      <Button icon={<SearchOutlined />} onClick={handleSearch} type="primary">
+        搜索
+      </Button>
+    ),
+    advance: (
+      <Dropdown.Button
+        icon={<SearchOutlined />}
+        placement={'bottomLeft'}
+        trigger={['click']}
+        onClick={handleSearch}
+        visible={logVisible}
+        onVisibleChange={async (visible) => {
+          setLogVisible(visible);
+          if (visible) {
+            await queryHistory();
+          }
+        }}
+        type="primary"
+        overlay={historyDom}
+      >
+        搜索
+      </Dropdown.Button>
+    ),
   };
-  const renderSimple = () => {
-    return (
-      <div className={styles.simple}>
-        <SchemaField schema={simpleSchema} />
-        <FormButtonGroup.FormItem labelCol={0} wrapperCol={14}>
-          <Button onClick={handleSearch} type="primary">
-            搜索
-          </Button>
-          <Button block onClick={resetForm}>
-            重置
+
+  const SaveBtn = (
+    <Popover
+      content={
+        <Form style={{ width: '217px' }} form={historyForm}>
+          <SchemaField
+            schema={{
+              type: 'object',
+              properties: {
+                alias: {
+                  'x-decorator': 'FormItem',
+                  'x-component': 'Input.TextArea',
+                  'x-validator': [
+                    {
+                      max: 50,
+                      message: '最多可输入50个字符',
+                    },
+                  ],
+                },
+              },
+            }}
+          />
+          <Button onClick={handleSaveLog} type="primary" className={styles.saveLog}>
+            保存
           </Button>
-        </FormButtonGroup.FormItem>
-      </div>
-    );
-  };
+        </Form>
+      }
+      visible={aliasVisible}
+      onVisibleChange={setAliasVisible}
+      title="搜索名称"
+      trigger="click"
+    >
+      <Button icon={<SaveOutlined />} block>
+        {intl.formatMessage({
+          id: 'pages.data.option.save',
+          defaultMessage: '保存',
+        })}
+      </Button>
+    </Popover>
+  );
+
   return (
-    <Card bordered={false} style={{ marginBottom: '20px', borderBottom: '1px solid #f0f0f0' }}>
+    <Card bordered={false} className={styles.container}>
       <Form form={form} className={styles.form} labelCol={4} wrapperCol={18}>
-        {pattern === 'advance' ? renderAdvance() : renderSimple()}
+        <div className={expand && styles.simple}>
+          <SchemaField schema={expand ? simpleSchema : schema} />
+          <div className={styles.action}>
+            <Space>
+              {enableSave ? SearchBtn.advance : SearchBtn.simple}
+              {enableSave && SaveBtn}
+              <Button icon={<ReloadOutlined />} block onClick={resetForm}>
+                重置
+              </Button>
+            </Space>
+            <div className={classnames(styles.more, !expand ? styles.simple : styles.advance)}>
+              <Button type="link" onClick={handleExpand}>
+                更多筛选
+                <DoubleRightOutlined style={{ marginLeft: 32 }} rotate={expand ? 90 : -90} />
+              </Button>
+            </div>
+          </div>
+        </div>
       </Form>
     </Card>
   );

+ 19 - 0
src/components/SearchComponent/readme.md

@@ -27,3 +27,22 @@
 
 - `digit` 数字类型
 - `dateTime` 日期时间
+
+## defaultParams
+
+支持两种类型的默认参数
+
+```typescript jsx
+const a = { [{ column: 'test', value: 'admin' }] };
+
+const b = {
+  [
+    {
+      terms: [{ column: 'parentId$isnull', value: '' }, { column: 'parentId$not', value: 'test', type: 'or' }],
+    },
+    {
+      terms: [{ column: 'id$not', value: 'test', type: 'and' }],
+    },
+  ]
+}
+```

+ 7 - 6
src/pages/device/Instance/Detail/ChildDevice/BindChildDevice/index.tsx

@@ -128,7 +128,8 @@ const BindChildDevice = (props: Props) => {
       <SearchComponent<DeviceInstance>
         field={[...columns]}
         target="child-device-bind"
-        pattern={'simple'}
+        enableSave={false}
+        // pattern={'simple'}
         defaultParam={[
           {
             terms: [
@@ -144,11 +145,11 @@ const BindChildDevice = (props: Props) => {
           actionRef.current?.reset?.();
           setSearchParams(param);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setSearchParams({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setSearchParams({});
+        // }}
       />
       <ProTable<DeviceInstance>
         search={false}

+ 7 - 6
src/pages/device/Instance/Detail/ChildDevice/index.tsx

@@ -120,7 +120,8 @@ const ChildDevice = () => {
       <SearchComponent<LogItem>
         field={[...columns]}
         target="child-device"
-        pattern={'simple'}
+        enableSave={false}
+        // pattern={'simple'}
         defaultParam={[
           { column: 'parentId', value: InstanceModel?.detail?.id || '', termType: 'eq' },
         ]}
@@ -128,11 +129,11 @@ const ChildDevice = () => {
           actionRef.current?.reset?.();
           setSearchParams(param);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setSearchParams({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setSearchParams({});
+        // }}
       />
       <ProTable<LogItem>
         search={false}

+ 7 - 6
src/pages/device/Instance/Detail/Log/index.tsx

@@ -86,16 +86,17 @@ const Log = () => {
       <SearchComponent<LogItem>
         field={[...columns]}
         target="logs"
-        pattern={'simple'}
+        enableSave={false}
+        // pattern={'simple'}
         onSearch={(param) => {
           actionRef.current?.reset?.();
           setSearchParams(param);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setSearchParams({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setSearchParams({});
+        // }}
       />
       <ProTable<LogItem>
         search={false}

+ 7 - 6
src/pages/device/Instance/Detail/Running/Event/index.tsx

@@ -112,17 +112,18 @@ const EventLog = (props: Props) => {
       <SearchComponent<any>
         field={[...createColumn(), ...columns]}
         target="events"
-        pattern={'simple'}
+        enableSave={false}
+        // pattern={'simple'}
         onSearch={(param) => {
           // 重置分页数据
           actionRef.current?.reset?.();
           setSearchParams(param);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setSearchParams({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setSearchParams({});
+        // }}
       />
       <ProTable
         size="small"

+ 5 - 5
src/pages/device/Instance/index.tsx

@@ -354,11 +354,11 @@ const Instance = () => {
           actionRef.current?.reset?.();
           setSearchParams(data);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setSearchParams({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setSearchParams({});
+        // }}
       />
       <ProTableCard<DeviceInstance>
         columns={columns}

+ 5 - 4
src/pages/device/Product/Detail/Access/AccessConfig/index.tsx

@@ -111,7 +111,8 @@ const AccessConfig = (props: Props) => {
       <div className={styles.search}>
         <SearchComponent
           field={columns}
-          pattern={'simple'}
+          // pattern={'simple'}
+          enableSave={false}
           onSearch={(data: any) => {
             const dt = {
               pageSize: 4,
@@ -119,9 +120,9 @@ const AccessConfig = (props: Props) => {
             };
             handleSearch(dt);
           }}
-          onReset={() => {
-            handleSearch({ pageSize: 4 });
-          }}
+          // onReset={() => {
+          //   handleSearch({ pageSize: 4 });
+          // }}
         />
         <div style={{ display: 'flex', justifyContent: 'flex-end' }}>
           <Button

+ 5 - 5
src/pages/device/Product/index.tsx

@@ -262,11 +262,11 @@ const Product = observer(() => {
       <SearchComponent
         field={columns}
         onSearch={searchFn}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          searchFn({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   searchFn({});
+        // }}
       />
       <ProTableCard<ProductItem>
         columns={columns}

+ 5 - 4
src/pages/link/AccessConfig/index.tsx

@@ -66,7 +66,8 @@ const AccessConfig = () => {
       <Card>
         <SearchComponent
           field={columns}
-          pattern={'simple'}
+          // pattern={'simple'}
+          enableSave={false}
           onSearch={(data: any) => {
             const dt = {
               pageSize: 10,
@@ -74,9 +75,9 @@ const AccessConfig = () => {
             };
             handleSearch(dt);
           }}
-          onReset={() => {
-            handleSearch({ pageSize: 10 });
-          }}
+          // onReset={() => {
+          //   handleSearch({ pageSize: 10 });
+          // }}
         />
         <div style={{ width: '100%', display: 'flex', justifyContent: 'flex-end' }}>
           <Button

+ 0 - 1
src/pages/link/Type/Detail/index.tsx

@@ -225,7 +225,6 @@ const Save = observer(() => {
           gridSpan: 1,
           labelAlign: 'left',
           layout: 'vertical',
-          tooltip: '绑定到服务器上的网卡地址,绑定到所有网卡:0.0.0.0 /',
         },
         'x-reactions': [
           {

+ 7 - 6
src/pages/system/Department/Assets/deivce/bind.tsx

@@ -102,7 +102,8 @@ const Bind = observer((props: Props) => {
       />
       <SearchComponent<DeviceItem>
         field={columns}
-        pattern={'simple'}
+        enableSave={false}
+        // pattern={'simple'}
         defaultParam={[
           {
             column: 'id',
@@ -122,11 +123,11 @@ const Bind = observer((props: Props) => {
           actionRef.current?.reset?.();
           setSearchParam(data);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setSearchParam({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setSearchParam({});
+        // }}
         target="department-assets-device"
       />
       <ProTable<DeviceItem>

+ 5 - 5
src/pages/system/Department/Assets/deivce/index.tsx

@@ -205,11 +205,11 @@ export default observer(() => {
           actionRef.current?.reset?.();
           setSearchParam(data);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setSearchParam({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setSearchParam({});
+        // }}
         target="department-assets-device"
       />
       <ProTable<DeviceItem>

+ 7 - 6
src/pages/system/Department/Assets/product/bind.tsx

@@ -90,7 +90,8 @@ const Bind = observer((props: Props) => {
       />
       <SearchComponent<ProductItem>
         field={columns}
-        pattern={'simple'}
+        // pattern={'simple'}
+        enableSave={false}
         defaultParam={[
           {
             column: 'id',
@@ -110,11 +111,11 @@ const Bind = observer((props: Props) => {
           actionRef.current?.reset?.();
           setSearchParam(data);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setSearchParam({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setSearchParam({});
+        // }}
         target="department-assets-product"
       />
       <ProTable<ProductItem>

+ 5 - 5
src/pages/system/Department/Assets/product/index.tsx

@@ -146,11 +146,11 @@ export default observer(() => {
           actionRef.current?.reset?.();
           setSearchParam(data);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setSearchParam({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setSearchParam({});
+        // }}
         target="department-assets-product"
       />
       <ProTable<ProductItem>

+ 7 - 6
src/pages/system/Department/Assets/productCategory/bind.tsx

@@ -89,7 +89,8 @@ const Bind = observer((props: Props) => {
       />
       <SearchComponent<ProductCategoryItem>
         field={columns}
-        pattern="simple"
+        enableSave={false}
+        // pattern="simple"
         defaultParam={[
           {
             column: 'id',
@@ -109,11 +110,11 @@ const Bind = observer((props: Props) => {
           actionRef.current?.reset?.();
           setSearchParam(data);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setSearchParam({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setSearchParam({});
+        // }}
         target="department-assets-category"
       />
       <ProTable<ProductCategoryItem>

+ 5 - 5
src/pages/system/Department/Assets/productCategory/index.tsx

@@ -166,11 +166,11 @@ export default observer(() => {
           actionRef.current?.reset?.();
           setSearchParam(data);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setSearchParam({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setSearchParam({});
+        // }}
         target="department-assets-category"
       />
       <ProTable<ProductCategoryItem>

+ 7 - 6
src/pages/system/Department/Member/bind.tsx

@@ -77,18 +77,19 @@ const Bind = observer((props: Props) => {
       title="绑定"
     >
       <SearchComponent<UserItem>
-        pattern={'simple'}
+        // pattern={'simple'}
+        enableSave={false}
         field={columns}
         defaultParam={[{ column: 'id$in-dimension$org$not', value: param.id }]}
         onSearch={async (data) => {
           actionRef.current?.reset?.();
           setSearchParam(data);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setSearchParam({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setSearchParam({});
+        // }}
         target="department-user"
       />
       <ProTable

+ 5 - 5
src/pages/system/Department/Member/index.tsx

@@ -164,11 +164,11 @@ const Member = observer(() => {
           actionRef.current?.reset?.();
           setSearchParam(data);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setSearchParam({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setSearchParam({});
+        // }}
         target="department-user"
       />
       <ProTable<MemberItem>

+ 6 - 6
src/pages/system/Department/index.tsx

@@ -2,6 +2,7 @@
 import { PageContainer } from '@ant-design/pro-layout';
 import type { ActionType, ProColumns } from '@jetlinks/pro-table';
 import ProTable from '@jetlinks/pro-table';
+import * as React from 'react';
 import { useEffect, useRef, useState } from 'react';
 import { Link, useIntl, useLocation } from 'umi';
 import { Button, message, Popconfirm, Tooltip } from 'antd';
@@ -21,7 +22,6 @@ import { model } from '@formily/reactive';
 import Save from './save';
 import SearchComponent from '@/components/SearchComponent';
 import { getMenuPathByParams, MENUS_CODE } from '@/utils/menu';
-import * as React from 'react';
 
 export const service = new Service('organization');
 
@@ -251,11 +251,11 @@ export default observer(() => {
           actionRef.current?.reset?.();
           setParam(data);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setParam({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setParam({});
+        // }}
         target="department"
       />
       <ProTable<DepartmentItem>

+ 2 - 2
src/pages/system/Department/save.tsx

@@ -4,6 +4,7 @@ import { createForm } from '@formily/core';
 import { createSchemaField } from '@formily/react';
 import {
   ArrayTable,
+  Checkbox,
   Editable,
   Form,
   FormGrid,
@@ -14,9 +15,8 @@ import {
   Password,
   Select,
   Switch,
-  Upload,
-  Checkbox,
   TreeSelect,
+  Upload,
 } from '@formily/antd';
 import { message, Modal } from 'antd';
 import { useIntl } from '@@/plugin-locale/localeExports';

+ 1 - 1
src/pages/system/Menu/Detail/edit.tsx

@@ -16,7 +16,7 @@ import Permission from '@/pages/system/Menu/components/permission';
 import { useIntl } from '@@/plugin-locale/localeExports';
 import { useEffect, useState } from 'react';
 import { service } from '@/pages/system/Menu';
-import { useRequest, useHistory } from 'umi';
+import { useHistory, useRequest } from 'umi';
 import type { MenuItem } from '@/pages/system/Menu/typing';
 // import { debounce } from 'lodash';
 import Title from '../components/Title';

+ 6 - 5
src/pages/system/Menu/index.tsx

@@ -224,12 +224,13 @@ export default observer(() => {
     <PageContainer>
       <SearchComponent
         field={columns}
+        target="menu"
         onSearch={searchFn}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          searchFn({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   searchFn({});
+        // }}
       />
       <ProTable<MenuItem>
         columns={columns}

+ 1 - 1
src/pages/system/Permission/Save/index.tsx

@@ -4,7 +4,7 @@ import { createForm, onFormSubmitStart } from '@formily/core';
 import { createSchemaField } from '@formily/react';
 import React, { useEffect, useState } from 'react';
 import * as ICONS from '@ant-design/icons';
-import { ArrayTable, Form, FormItem, Input, Editable } from '@formily/antd';
+import { ArrayTable, Editable, Form, FormItem, Input } from '@formily/antd';
 import type { ISchema } from '@formily/json-schema';
 import type { PermissionItem } from '@/pages/system/Permission/typings';
 import { service } from '@/pages/system/Permission';

+ 6 - 6
src/pages/system/Permission/index.tsx

@@ -9,12 +9,12 @@ import {
 } from '@ant-design/icons';
 import { Badge, Button, Dropdown, Menu, message, Popconfirm, Tooltip, Upload } from 'antd';
 import type { ActionType, ProColumns } from '@jetlinks/pro-table';
+import ProTable from '@jetlinks/pro-table';
 import { useIntl } from '@@/plugin-locale/localeExports';
 import type { PermissionItem } from '@/pages/system/Permission/typings';
 import Service from '@/pages/system/Permission/service';
 import { observer } from '@formily/react';
 import SearchComponent from '@/components/SearchComponent';
-import ProTable from '@jetlinks/pro-table';
 import Save from './Save';
 import SystemConst from '@/utils/const';
 import { downloadObject } from '@/utils/util';
@@ -234,11 +234,11 @@ const Permission: React.FC = observer(() => {
           actionRef.current?.reset?.();
           setParam(data);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setParam({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setParam({});
+        // }}
       />
       <ProTable<PermissionItem>
         actionRef={actionRef}

+ 7 - 6
src/pages/system/Role/Detail/UserManage/BindUser.tsx

@@ -75,18 +75,19 @@ const BindUser = (props: Props) => {
       <SearchComponent<UserItem>
         field={columns}
         target="user"
-        pattern={'simple'}
+        // pattern={'simple'}
+        enableSave={false}
         onSearch={(data) => {
           // console.log(data);
           // 重置分页数据
           actionRef.current?.reset?.();
           setParam(data);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setParam({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setParam({});
+        // }}
       />
       <ProTable
         actionRef={actionRef}

+ 5 - 5
src/pages/system/Role/Detail/UserManage/index.tsx

@@ -97,11 +97,11 @@ const UserManage = () => {
           actionRef.current?.reset?.();
           setParam(data);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setParam({});
-        }}
+        // onReset={() => {
+        //   // 重置分页及搜索参数
+        //   actionRef.current?.reset?.();
+        //   setParam({});
+        // }}
       />
       <ProTable
         actionRef={actionRef}

+ 0 - 5
src/pages/system/User/index.tsx

@@ -181,11 +181,6 @@ const User = observer(() => {
           actionRef.current?.reset?.();
           setParam(data);
         }}
-        onReset={() => {
-          // 重置分页及搜索参数
-          actionRef.current?.reset?.();
-          setParam({});
-        }}
       />
       <ProTable<UserItem>
         actionRef={actionRef}

+ 1 - 1
src/utils/menu/index.ts

@@ -1,7 +1,7 @@
 // 路由components映射
 import type { IRouteProps } from 'umi';
 import type { MenuItem } from '@/pages/system/Menu/typing';
-import { MENUS_CODE, getDetailNameByCode } from './router';
+import { getDetailNameByCode, MENUS_CODE } from './router';
 
 /** localStorage key */
 export const MENUS_DATA_CACHE = 'MENUS_DATA_CACHE';