Kaynağa Gözat

fix: bug修复

wzyyy 3 yıl önce
ebeveyn
işleme
3fc388b2ff

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

@@ -226,7 +226,7 @@ const Debug = observer((props: Props) => {
                   runScriptAgain();
                   runScriptAgain();
                 }}
                 }}
               >
               >
-                <a style={{ marginLeft: 90 }}>发送数据</a>
+                <a style={{ marginLeft: 75 }}>发送数据</a>
               </div>
               </div>
             )}
             )}
           </div>
           </div>

+ 2 - 2
src/components/ProTableCard/CardItems/applyCard.tsx

@@ -24,8 +24,8 @@ export default (props: DeviceCardProps) => {
       // showMask={false}
       // showMask={false}
       detail={props.detail}
       detail={props.detail}
       actions={props.actions}
       actions={props.actions}
-      status={props.state}
-      statusText={props.state === 'disabled' ? '禁用' : '正常'}
+      status={props.state?.value}
+      statusText={props.state?.value === 'disabled' ? '禁用' : '正常'}
       statusNames={{
       statusNames={{
         enabled: StatusColorEnum.success,
         enabled: StatusColorEnum.success,
         disabled: StatusColorEnum.error,
         disabled: StatusColorEnum.error,

+ 19 - 9
src/pages/link/Channel/Modbus/Export/index.tsx

@@ -26,15 +26,25 @@ const Export = (props: Props) => {
   });
   });
 
 
   useEffect(() => {
   useEffect(() => {
-    service.queryMaster({ paging: false }).then((resp) => {
-      if (resp.status === 200) {
-        const items = resp.result.map((item: { name: any; id: any }) => ({
-          label: item.name,
-          value: item.id,
-        }));
-        setList(items);
-      }
-    });
+    service
+      .queryMaster({
+        paging: false,
+        sorts: [
+          {
+            name: 'createTime',
+            order: 'desc',
+          },
+        ],
+      })
+      .then((resp) => {
+        if (resp.status === 200) {
+          const items = resp.result.map((item: { name: any; id: any }) => ({
+            label: item.name,
+            value: item.id,
+          }));
+          setList(items);
+        }
+      });
   }, []);
   }, []);
 
 
   const form = createForm();
   const form = createForm();

+ 13 - 1
src/pages/system/Apply/Api/leftTree.tsx

@@ -62,8 +62,19 @@ export default (props: LeftTreeType) => {
     if (!data || !(data && Object.keys(data).length)) {
     if (!data || !(data && Object.keys(data).length)) {
       return [];
       return [];
     }
     }
-    const newArr = data.tags.map((item: any) => ({ id: item.name, name: item.name, isLeaf: true }));
+    const array: any = [];
+    Object.keys(data.paths).forEach((a: any) => {
+      Object.keys(data.paths[a]).forEach((b) => {
+        const { tags } = data.paths[a][b];
+        array.push(tags[0]);
+      });
+    });
 
 
+    const newArr: any = [...new Set(array)].map((item: any) => ({
+      id: item,
+      name: item,
+      isLeaf: true,
+    }));
     Object.keys(data.paths).forEach((a: any) => {
     Object.keys(data.paths).forEach((a: any) => {
       Object.keys(data.paths[a]).forEach((b) => {
       Object.keys(data.paths[a]).forEach((b) => {
         const { tags, ...extraData } = data.paths[a][b];
         const { tags, ...extraData } = data.paths[a][b];
@@ -79,6 +90,7 @@ export default (props: LeftTreeType) => {
         }
         }
       });
       });
     });
     });
+    // console.log(newArr)
     return newArr;
     return newArr;
   };
   };
 
 

+ 6 - 0
src/pages/system/Apply/Save/index.tsx

@@ -435,6 +435,7 @@ const Save = () => {
     'sso.configuration.oauth2.type': {
     'sso.configuration.oauth2.type': {
       type: 'string',
       type: 'string',
       title: '认证方式',
       title: '认证方式',
+      required: true,
       'x-decorator': 'FormItem',
       'x-decorator': 'FormItem',
       'x-decorator-props': {
       'x-decorator-props': {
         gridSpan: 2,
         gridSpan: 2,
@@ -464,6 +465,7 @@ const Save = () => {
     'sso.configuration.oauth2.clientId': {
     'sso.configuration.oauth2.clientId': {
       type: 'string',
       type: 'string',
       title: 'client_id',
       title: 'client_id',
+      required: true,
       'x-decorator': 'FormItem',
       'x-decorator': 'FormItem',
       'x-decorator-props': {
       'x-decorator-props': {
         gridSpan: 2,
         gridSpan: 2,
@@ -478,6 +480,7 @@ const Save = () => {
     'sso.configuration.oauth2.clientSecret': {
     'sso.configuration.oauth2.clientSecret': {
       type: 'string',
       type: 'string',
       title: 'client_secret',
       title: 'client_secret',
+      required: true,
       'x-decorator': 'FormItem',
       'x-decorator': 'FormItem',
       'x-decorator-props': {
       'x-decorator-props': {
         gridSpan: 2,
         gridSpan: 2,
@@ -492,6 +495,7 @@ const Save = () => {
     'sso.configuration.oauth2.authorizationUrl': {
     'sso.configuration.oauth2.authorizationUrl': {
       type: 'string',
       type: 'string',
       title: '授权地址',
       title: '授权地址',
+      required: true,
       'x-decorator': 'FormItem',
       'x-decorator': 'FormItem',
       'x-decorator-props': {
       'x-decorator-props': {
         gridSpan: 2,
         gridSpan: 2,
@@ -506,6 +510,7 @@ const Save = () => {
     'sso.configuration.oauth2.tokenUrl': {
     'sso.configuration.oauth2.tokenUrl': {
       type: 'string',
       type: 'string',
       title: 'token地址',
       title: 'token地址',
+      required: true,
       'x-decorator': 'FormItem',
       'x-decorator': 'FormItem',
       'x-decorator-props': {
       'x-decorator-props': {
         gridSpan: 2,
         gridSpan: 2,
@@ -520,6 +525,7 @@ const Save = () => {
     'sso.configuration.oauth2.userInfoUrl': {
     'sso.configuration.oauth2.userInfoUrl': {
       type: 'string',
       type: 'string',
       title: '用户信息地址',
       title: '用户信息地址',
+      required: true,
       'x-decorator': 'FormItem',
       'x-decorator': 'FormItem',
       'x-decorator-props': {
       'x-decorator-props': {
         gridSpan: 2,
         gridSpan: 2,

+ 8 - 8
src/pages/system/Apply/index.tsx

@@ -224,13 +224,13 @@ const Apply = () => {
         <PermissionButton
         <PermissionButton
           isPermission={permission.delete}
           isPermission={permission.delete}
           tooltip={{
           tooltip={{
-            title: record.state !== 'disabled' ? '删除' : '请先禁用该应用,再删除',
+            title: record.state.value !== 'disabled' ? '删除' : '请先禁用该应用,再删除',
           }}
           }}
           style={{ padding: 0 }}
           style={{ padding: 0 }}
-          disabled={record.state !== 'disabled'}
+          disabled={record.state.value !== 'disabled'}
           popConfirm={{
           popConfirm={{
             title: '确认删除',
             title: '确认删除',
-            disabled: record.state !== 'disabled',
+            disabled: record.state.value !== 'disabled',
             onConfirm: async () => {
             onConfirm: async () => {
               const resp: any = await service.remove(record.id);
               const resp: any = await service.remove(record.id);
               if (resp.status === 200) {
               if (resp.status === 200) {
@@ -357,12 +357,12 @@ const Apply = () => {
                 type={'link'}
                 type={'link'}
                 style={{ padding: 0 }}
                 style={{ padding: 0 }}
                 tooltip={{
                 tooltip={{
-                  title: record.state !== 'disabled' ? '禁用' : '启用',
+                  title: record.state.value !== 'disabled' ? '禁用' : '启用',
                 }}
                 }}
                 popConfirm={{
                 popConfirm={{
-                  title: `确认${record.state !== 'disabled' ? '禁用' : '启用'}`,
+                  title: `确认${record.state.value !== 'disabled' ? '禁用' : '启用'}`,
                   onConfirm: () => {
                   onConfirm: () => {
-                    if (record.state === 'disabled') {
+                    if (record.state.value === 'disabled') {
                       _action(record.id, {
                       _action(record.id, {
                         state: 'enabled',
                         state: 'enabled',
                       });
                       });
@@ -374,8 +374,8 @@ const Apply = () => {
                   },
                   },
                 }}
                 }}
               >
               >
-                {record.state !== 'disabled' ? <StopOutlined /> : <PlayCircleOutlined />}
-                {record.state !== 'disabled' ? '禁用' : '启用'}
+                {record.state.value !== 'disabled' ? <StopOutlined /> : <PlayCircleOutlined />}
+                {record.state.value !== 'disabled' ? '禁用' : '启用'}
               </PermissionButton>,
               </PermissionButton>,
               (isPage(record.integrationModes) || isApiService(record.integrationModes)) && (
               (isPage(record.integrationModes) || isApiService(record.integrationModes)) && (
                 <Dropdown
                 <Dropdown

+ 1 - 1
src/pages/system/Apply/typings.d.ts

@@ -7,7 +7,7 @@ type ApplyItem = {
   page?: Record<string, unknown>;
   page?: Record<string, unknown>;
   apiServer?: Record<string, unknown>;
   apiServer?: Record<string, unknown>;
   sso?: Record<string, unknown>;
   sso?: Record<string, unknown>;
-  state: string;
+  state: any;
   creatorId: string;
   creatorId: string;
   createTime: number;
   createTime: number;
 };
 };

+ 13 - 1
src/pages/system/Platforms/Api/leftTree.tsx

@@ -62,8 +62,19 @@ export default (props: LeftTreeType) => {
     if (!data || !(data && Object.keys(data).length)) {
     if (!data || !(data && Object.keys(data).length)) {
       return [];
       return [];
     }
     }
-    const newArr = data.tags.map((item: any) => ({ id: item.name, name: item.name, isLeaf: true }));
+    const array: any = [];
+    Object.keys(data.paths).forEach((a: any) => {
+      Object.keys(data.paths[a]).forEach((b) => {
+        const { tags } = data.paths[a][b];
+        array.push(tags[0]);
+      });
+    });
 
 
+    const newArr: any = [...new Set(array)].map((item: any) => ({
+      id: item,
+      name: item,
+      isLeaf: true,
+    }));
     Object.keys(data.paths).forEach((a: any) => {
     Object.keys(data.paths).forEach((a: any) => {
       Object.keys(data.paths[a]).forEach((b) => {
       Object.keys(data.paths[a]).forEach((b) => {
         const { tags, ...extraData } = data.paths[a][b];
         const { tags, ...extraData } = data.paths[a][b];
@@ -79,6 +90,7 @@ export default (props: LeftTreeType) => {
         }
         }
       });
       });
     });
     });
+    // console.log(newArr)
     return newArr;
     return newArr;
   };
   };