wzyyy 3 lat temu
rodzic
commit
da3f88f72d

+ 2 - 2
README.md

@@ -9,8 +9,8 @@ Language : 🇺🇸 | [🇨🇳](./README.zh-CN.md) | [🇷🇺](./README.ru-RU.
 ```bash
 $ git clone git@gitee.com:jetlinks-projects/smart-building-platform-ui.git
 $ cd <your-project-name>
-$ npm install
-$ npm start         # visit http://localhost:8000
+$ npm install / yarn install
+$ npm start / yarn start        # visit http://localhost:8000
 ```
 
 ### Use Gitpod

+ 2 - 2
src/pages/device/Instance/Detail/Reation/Edit.tsx

@@ -60,12 +60,13 @@ const Edit = (props: Props) => {
 
   const configToSchema = (list: any[]) => {
     const config = {};
-    list.forEach((item) => {
+    list.forEach((item, index) => {
       config[item.relation] = {
         type: 'string',
         title: item.relationName,
         'x-decorator': 'FormItem',
         'x-component': 'Select',
+        'x-index': index,
         'x-component-props': {
           placeholder: `请选择${item.relationName}`,
           showSearch: true,
@@ -115,7 +116,6 @@ const Edit = (props: Props) => {
     });
     setInitData(obj);
     form.setValues(obj);
-    // console.log(props.data,obj)
   }, [props.data]);
 
   return (

+ 9 - 6
src/pages/device/Instance/index.tsx

@@ -34,6 +34,7 @@ import { useLocation } from '@/hooks';
 import { service as deptService } from '@/pages/system/Department';
 import { service as categoryService } from '@/pages/device/Category';
 import { onlyMessage } from '@/utils/util';
+import { isNoCommunity } from '@/utils/util';
 
 export const statusMap = new Map();
 statusMap.set('在线', 'processing');
@@ -331,12 +332,14 @@ const Instance = () => {
         service.getProviders().then((resp: any) => {
           return (resp?.result || [])
             .filter((i: any) =>
-              [
-                'mqtt-server-gateway',
-                'http-server-gateway',
-                'mqtt-client-gateway',
-                'tcp-server-gateway',
-              ].includes(i.id),
+              !isNoCommunity
+                ? [
+                    'mqtt-server-gateway',
+                    'http-server-gateway',
+                    'mqtt-client-gateway',
+                    'tcp-server-gateway',
+                  ].includes(i.id)
+                : i,
             )
             .map((item: any) => ({
               label: item.name,

+ 8 - 1
src/pages/init-home/components/data/save/index.tsx

@@ -100,6 +100,10 @@ const Save = (props: Props) => {
                 min: 1,
                 message: '请输入1-65535之间的正整数',
               },
+              {
+                required: true,
+                message: '请选择本地端口',
+              },
             ],
           },
           publicHost: {
@@ -118,7 +122,10 @@ const Save = (props: Props) => {
             'x-decorator': 'FormItem',
             'x-component': 'Input',
             'x-validator': [
-              'ipv4',
+              {
+                format: 'ipv4',
+                message: '请输入域名或IP',
+              },
               {
                 required: true,
                 message: '请输入域名或IP',