100011797 3 лет назад
Родитель
Сommit
04f11370d6

+ 31 - 2
src/pages/device/Instance/index.tsx

@@ -413,6 +413,31 @@ const Instance = () => {
     },
   ];
 
+  const paramsFormat = (config: any, _terms: any, name?: string) => {
+    if (config?.terms && Array.isArray(config.terms) && config?.terms.length > 0) {
+      (config?.terms || []).map((item: any, index: number) => {
+        if (item?.type) {
+          _terms[`${name ? `${name}.` : ''}terms[${index}].type`] = item.type;
+        }
+        paramsFormat(item, _terms, `${name ? `${name}.` : ''}terms[${index}]`);
+      });
+    } else if (!config?.terms && Object.keys(config).length > 0) {
+      Object.keys(config).forEach((key) => {
+        _terms[`${name ? `${name}.` : ''}${key}`] = config[key];
+      });
+    }
+  };
+
+  const handleParams = (config: any) => {
+    const _terms: any = {};
+    paramsFormat(config, _terms);
+    const url = new URLSearchParams();
+    Object.keys(_terms).forEach((key) => {
+      url.append(key, _terms[key]);
+    });
+    return url.toString();
+  };
+
   const menu = (
     <Menu>
       <Menu.Item key="1">
@@ -450,7 +475,9 @@ const Instance = () => {
               setType('active');
               const activeAPI = `/${
                 SystemConst.API_BASE
-              }/device-instance/deploy?:X_Access_Token=${Token.get()}`;
+              }/device-instance/deploy?:X_Access_Token=${Token.get()}&${handleParams(
+                searchParams,
+              )}`;
               setApi(activeAPI);
               setOperationVisible(true);
             },
@@ -468,7 +495,9 @@ const Instance = () => {
             setType('sync');
             const syncAPI = `/${
               SystemConst.API_BASE
-            }/device-instance/state/_sync?:X_Access_Token=${Token.get()}`;
+            }/device-instance/state/_sync?:X_Access_Token=${Token.get()}&${handleParams(
+              searchParams,
+            )}`;
             setApi(syncAPI);
             setOperationVisible(true);
           }}

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

@@ -100,14 +100,10 @@ const BindUser = (props: Props) => {
             setSelectedRowKeys(key as string[]);
           },
         }}
-        pagination={{
-          pageSize: 10,
-        }}
         columnEmptyText={''}
         request={async (params: any) => {
           const response = await service.query({
-            pageSize: params.pageSize,
-            pageIndex: params.current,
+            ...params,
             terms: [
               ...(param?.terms || []),
               {