فهرست منبع

fix: 修复触发条件无法显示问题

xieyonghong 3 سال پیش
والد
کامیت
1eecdc1c84
3فایلهای تغییر یافته به همراه10 افزوده شده و 13 حذف شده
  1. 1 1
      src/pages/rule-engine/Scene/Save/index.tsx
  2. 3 3
      src/pages/system/Platforms/index.tsx
  3. 6 9
      src/pages/system/Platforms/save.tsx

+ 1 - 1
src/pages/rule-engine/Scene/Save/index.tsx

@@ -209,7 +209,7 @@ export default () => {
           className={'scene-save'}
           onValuesChange={(changeValue, allValues) => {
             if (changeValue.trigger) {
-              if (changeValue.trigger.type === 'device' && changeValue.trigger.device) {
+              if (changeValue.trigger.device) {
                 if (
                   changeValue.trigger.device.selectorValues ||
                   (changeValue.trigger.device.operation &&

+ 3 - 3
src/pages/system/Platforms/index.tsx

@@ -12,7 +12,7 @@ import PasswordModal from './password';
 import Service from './service';
 import { message } from 'antd';
 
-export const service = new Service('platforms');
+export const service = new Service('api-client');
 
 export default () => {
   const actionRef = useRef<ActionType>();
@@ -37,11 +37,11 @@ export default () => {
       title: '名称',
     },
     {
-      dataIndex: 'accessName',
+      dataIndex: 'username',
       title: '用户名',
     },
     {
-      dataIndex: 'role',
+      dataIndex: 'roleIdList',
       title: '角色',
     },
     {

+ 6 - 9
src/pages/system/Platforms/save.tsx

@@ -23,6 +23,7 @@ import usePermissions from '@/hooks/permission';
 import { action } from '@formily/reactive';
 import { Response } from '@/utils/typings';
 import { service } from '@/pages/system/Platforms/index';
+import { randomString } from '@/utils/util';
 
 interface SaveProps {
   visible: boolean;
@@ -76,7 +77,7 @@ export default (props: SaveProps) => {
     () =>
       createForm({
         validateFirst: true,
-        initialValues: props.data || { oath2: true },
+        initialValues: props.data || { oath2: true, id: randomString() },
       }),
     [props.data],
   );
@@ -116,7 +117,7 @@ export default (props: SaveProps) => {
               },
             ],
           },
-          clientId: {
+          id: {
             type: 'string',
             title: 'clientId',
             'x-decorator': 'FormItem',
@@ -152,7 +153,7 @@ export default (props: SaveProps) => {
               },
             ],
           },
-          accessName: {
+          username: {
             type: 'string',
             title: '用户名',
             'x-decorator': 'FormItem',
@@ -291,7 +292,7 @@ export default (props: SaveProps) => {
               },
             ],
           },
-          oath2: {
+          enableOAuth2: {
             type: 'boolean',
             title: '开启OAth2',
             required: true,
@@ -334,7 +335,7 @@ export default (props: SaveProps) => {
               },
             ],
           },
-          ipAddress: {
+          ipWhiteList: {
             type: 'string',
             title: 'IP白名单',
             'x-decorator': 'FormItem',
@@ -362,10 +363,6 @@ export default (props: SaveProps) => {
               maxLength: 200,
             },
           },
-          id: {
-            type: 'string',
-            'x-hidden': true,
-          },
         },
       },
     },