Преглед изворни кода

fix: 修复部分已知bug

hear пре 2 година
родитељ
комит
fd52112370

+ 2 - 2
docker/build.sh

@@ -1,3 +1,3 @@
 #!/usr/bin/env bash
-docker build -t registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-pro:2.0.0-SNAPSHOT .
-docker push registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-pro:2.0.0-SNAPSHOT
+docker build -t registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-pro:2.0.0 .
+docker push registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-pro:2.0.0

+ 4 - 4
src/pages/device/Instance/Detail/Functions/index.tsx

@@ -3,7 +3,7 @@ import { InstanceModel } from '@/pages/device/Instance';
 import type { FunctionMetadata } from '@/pages/device/Product/typings';
 import FnForm from './form';
 import AModel from './AdvancedMode';
-import { useDomFullHeight } from '@/hooks';
+// import { useDomFullHeight } from '@/hooks';
 import Empty from '@/pages/device/components/Empty';
 import { ExclamationCircleOutlined } from '@ant-design/icons';
 
@@ -11,10 +11,10 @@ const Functions = () => {
   const functionList = JSON.parse(InstanceModel.detail.metadata || '{}')
     .functions as FunctionMetadata[];
 
-  const { minHeight } = useDomFullHeight(`.device-detail-function`);
+  // const { minHeight } = useDomFullHeight(`.device-detail-function`);
 
   return (
-    <Card className={'device-detail-function'} style={{ minHeight: minHeight }}>
+    <Card className={'device-detail-function'}>
       {functionList && functionList.length ? (
         <Tabs>
           <Tabs.TabPane tab={'精简模式'} key={1}>
@@ -68,7 +68,7 @@ const Functions = () => {
           </Tabs.TabPane>
         </Tabs>
       ) : (
-        <div style={{ height: minHeight - 150 }}>
+        <div>
           <Empty />
         </div>
       )}

+ 1 - 2
src/pages/system/Apply/Api/base.tsx

@@ -76,9 +76,8 @@ export default observer((props: ApiPageProps) => {
   }, []);
 
   useEffect(() => {
-    console.log(ApiModel.data);
+    console.log('----------', ApiModel.data);
   }, [ApiModel.data]);
-  console.log(ApiModel.showTable);
 
   return (
     <div className={'platforms-api'}>

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

@@ -425,7 +425,7 @@ const Apply = () => {
                         </Menu.Item>
                       )}
                       {isApiService(record.integrationModes) && (
-                        <Menu.Item key="empowerment">
+                        <Menu.Item key="api">
                           <PermissionButton
                             key={'api'}
                             type={'link'}

+ 1 - 1
src/pages/system/DataSource/Management/EditTable.tsx

@@ -147,7 +147,7 @@ const EditTable = (props: Props) => {
               'x-component': 'ArrayTable.Column',
               'x-component-props': { title: '精度' },
               properties: {
-                precision: {
+                scale: {
                   type: 'number',
                   'x-decorator': 'FormItem',
                   'x-component': 'NumberPicker',

+ 15 - 3
src/pages/system/Department/Assets/deivce/bind.tsx

@@ -354,15 +354,27 @@ const Bind = observer((props: Props) => {
             },
             onSelectAll: (selected, selectedRows, changeRows) => {
               if (selected) {
-                Models.bindKeys = [
-                  ...new Set([...Models.bindKeys, ...getSelectedRowsKey(selectedRows)]),
-                ];
+                const arr = selectedRows.filter(
+                  (item: any) => !!item?.permissionInfoList.find((it: any) => it.id === 'share'),
+                );
+                arr.forEach((e: any) => {
+                  const list = e?.permissionInfoList
+                    .map((it: any) => it.id)
+                    .filter?.((item: any) => checkAssets.includes(item));
+                  bindChecks.current.set(e.id, list);
+                });
+                Models.bindKeys = [...new Set([...Models.bindKeys, ...getSelectedRowsKey(arr)])];
+                console.log('onSelectAll', arr);
               } else {
                 const unChangeRowsKeys = getSelectedRowsKey(changeRows);
+                unChangeRowsKeys.forEach((item: any) => bindChecks.current.delete(item.id));
                 Models.bindKeys = Models.bindKeys
                   .concat(unChangeRowsKeys)
                   .filter((item) => !unChangeRowsKeys.includes(item));
               }
+              AssetsModel.params = {
+                productId: Models.bindKeys,
+              };
             },
           }}
           request={async (params) => {

+ 9 - 2
src/pages/system/Department/Assets/product/bind.tsx

@@ -362,12 +362,19 @@ const Bind = observer((props: Props) => {
               onSelectAll: (selected, selectedRows, changeRows) => {
                 if (selected) {
                   const arr = selectedRows.filter(
-                    (item: any) => !!item.permissionInfoList.find((it: any) => it.id === 'share'),
+                    (item: any) => !!item?.permissionInfoList.find((it: any) => it.id === 'share'),
                   );
-                  // console.log(arr)
+                  arr.forEach((e: any) => {
+                    const list = e?.permissionInfoList
+                      .map((it: any) => it.id)
+                      .filter?.((item: any) => checkAssets.includes(item));
+                    bindChecks.current.set(e.id, list);
+                  });
                   Models.bindKeys = [...new Set([...Models.bindKeys, ...getSelectedRowsKey(arr)])];
+                  console.log('onSelectAll', arr);
                 } else {
                   const unChangeRowsKeys = getSelectedRowsKey(changeRows);
+                  unChangeRowsKeys.forEach((item: any) => bindChecks.current.delete(item.id));
                   Models.bindKeys = Models.bindKeys
                     .concat(unChangeRowsKeys)
                     .filter((item) => !unChangeRowsKeys.includes(item));

+ 11 - 3
src/pages/system/Platforms/Api/basePage.tsx

@@ -107,6 +107,7 @@ export default (props: TableProps) => {
 
     const addOperations = addGrant.map((a: string) => {
       const item = dataSource.find((b) => b.operationId === a);
+      console.log('item', item);
       return {
         id: a,
         permissions: item?.security,
@@ -134,11 +135,19 @@ export default (props: TableProps) => {
         onlyMessage('操作成功');
       }
     } else {
+      // console.log('del',removeOperations);
+      // console.log('add',addOperations,addGrant);
       const resp2 = await service.removeApiGrant(code!, {
-        operations: removeOperations.filter((item: any) => item.permissions),
+        operations: removeOperations.map((item: any) => ({
+          ...item,
+          permissions: item.permissions ? item.permissions : [],
+        })),
       });
       const resp = await service.addApiGrant(code!, {
-        operations: addOperations.filter((item) => item.permissions),
+        operations: addOperations.map((item) => ({
+          ...item,
+          permissions: item.permissions ? item.permissions : [],
+        })),
       });
       if (resp.status === 200 || resp2.status === 200) {
         getApiGrant();
@@ -169,7 +178,6 @@ export default (props: TableProps) => {
                   type={'link'}
                   style={{ padding: 0, width: '100%', textAlign: 'left' }}
                   onClick={() => {
-                    console.log(record);
                     ApiModel.showTable = false;
                     ApiModel.swagger = record;
                   }}