hear пре 3 година
родитељ
комит
92a943902f

+ 1 - 0
src/components/SearchComponent/index.tsx

@@ -778,6 +778,7 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
         }}
         type="primary"
         overlay={historyDom}
+        overlayStyle={{ height: 350, overflow: 'auto' }}
         htmlType={'submit'}
       >
         搜索

+ 8 - 5
src/db.ts

@@ -3,6 +3,7 @@ import SystemConst from '@/utils/const';
 
 class DexieDB {
   public db: Dexie;
+  public id: string | undefined;
 
   constructor() {
     this.db = new Dexie(SystemConst.API_BASE);
@@ -15,15 +16,17 @@ class DexieDB {
       functions: 'id,name',
       tags: 'id,name',
     });
+    this.id = undefined;
   }
 
-  getDB() {
+  getDB(id?: string) {
+    this.id = id;
     if (this.db && this.db?.verno === 0) {
       // 考虑优化
       // 获取不到真实的数据库版本
       // 所以当获取到的数据库版本号为0则删除数据库重新初始化
       this.db.delete();
-      this.db = new Dexie(SystemConst.API_BASE);
+      this.db = new Dexie(`${SystemConst.API_BASE}_${id}`);
       this.db.version(1);
       return this.db;
     }
@@ -36,11 +39,11 @@ class DexieDB {
    * @param extendedSchema
    */
   updateSchema = async (extendedSchema: Record<string, string | null>) => {
-    await this.getDB().close();
-    await this.getDB()
+    await this.getDB(this.id!).close();
+    await this.getDB(this.id!)
       .version(this.db.verno + 1)
       .stores(extendedSchema);
-    return this.getDB().open();
+    return this.getDB(this.id!).open();
   };
 }
 

+ 3 - 3
src/pages/DataCollect/Channel/Save/index.tsx

@@ -196,11 +196,11 @@ export default (props: Props) => {
               },
               {
                 max: 65535,
-                message: '请输入0-65535之间的正整数',
+                message: '请输入1-65535之间的正整数',
               },
               {
-                min: 0,
-                message: '请输入0-65535之间的正整数',
+                min: 1,
+                message: '请输入1-65535之间的正整数',
               },
             ],
             'x-reactions': {

+ 12 - 4
src/pages/device/Product/Detail/Access/AccessConfig/index.tsx

@@ -82,10 +82,18 @@ const AccessConfig = (props: Props) => {
               // },
             ],
     };
-    service.queryList({ ...temp, sorts: [{ name: 'createTime', order: 'desc' }] }).then((resp) => {
-      setDataSource(resp?.result);
-      setCurrent(resp?.result?.data?.[0]);
-    });
+    service
+      .queryList({
+        ...temp,
+        sorts: [
+          { name: 'id', value: productModel.current?.accessId },
+          { name: 'createTime', order: 'desc' },
+        ],
+      })
+      .then((resp) => {
+        setDataSource(resp?.result);
+        // setCurrent(resp?.result?.data?.[0]);
+      });
   };
 
   const columns: ProColumns<any>[] = [

+ 1 - 1
src/pages/device/components/Metadata/Base/Edit/index.tsx

@@ -798,7 +798,7 @@ const Edit = observer((props: Props) => {
                     'x-validator': [
                       {
                         // triggerType: 'onBlur',
-                        validator: (value: any[]) => {
+                        validator: (value: any) => {
                           return new Promise((resolve) => {
                             const number = Number(value);
                             if (number <= 0 || value.length > 64 || /[.]/.test(value)) {

+ 6 - 4
src/pages/device/components/Metadata/Base/index.tsx

@@ -49,7 +49,7 @@ const BaseMetadata = observer((props: Props) => {
 
   const removeItem = async (record: MetadataItem) => {
     const removeDB = () => {
-      return DB.getDB().table(`${type}`).delete(record.id!);
+      return DB.getDB(param.id).table(`${type}`).delete(record.id!);
     };
     const _currentData = removeMetadata(type, [record], typeMap.get(target), removeDB);
     const result = await asyncUpdateMedata(target, _currentData);
@@ -129,8 +129,10 @@ const BaseMetadata = observer((props: Props) => {
   ];
 
   const initData = useCallback(async () => {
-    const result = await DB.getDB().table(`${type}`).toArray();
-    console.log(result);
+    // resetMetadata()
+    const result = await DB.getDB(param.id).table(`${type}`).toArray();
+    console.log('------sssss--', result);
+
     setData(result.sort((a, b) => b?.sortsIndex - a?.sortsIndex));
   }, [param.id, type]);
 
@@ -157,7 +159,7 @@ const BaseMetadata = observer((props: Props) => {
       //   .startsWithAnyOfIgnoreCase(name)
       //   .toArray();
       // setData(result.sort((a, b) => b?.sortsIndex - a?.sortsIndex));
-      const result = await DB.getDB().table(`${type}`).toArray();
+      const result = await DB.getDB(param.id).table(`${type}`).toArray();
       const arr = result
         .filter((item) => item.name.indexOf(name) > -1)
         .sort((a, b) => b?.sortsIndex - a?.sortsIndex);

+ 8 - 0
src/pages/link/AccessConfig/Detail/Media/index.tsx

@@ -247,6 +247,10 @@ const Media = (props: Props) => {
                   required: true,
                   message: '请输入SIP域',
                 },
+                {
+                  max: 64,
+                  message: '最大可输入64个字符',
+                },
               ],
             },
             'configuration.sipId': {
@@ -265,6 +269,10 @@ const Media = (props: Props) => {
                   required: true,
                   message: '请输入SIP ID',
                 },
+                {
+                  max: 64,
+                  message: '最大可输入64个字符',
+                },
               ],
             },
             'configuration.shareCluster': {

+ 8 - 1
src/pages/link/AccessConfig/Detail/components/Finish/index.tsx

@@ -294,7 +294,14 @@ const Finish = (props: Props) => {
         <div>
           <TitleComponent data={'基本信息'} />
           <Form name="basic" layout="vertical" form={form}>
-            <Form.Item label="名称" name="name" rules={[{ required: true, message: '请输入名称' }]}>
+            <Form.Item
+              label="名称"
+              name="name"
+              rules={[
+                { required: true, message: '请输入名称' },
+                { max: 64, message: '最多可输入64字符' },
+              ]}
+            >
               <Input placeholder="请输入名称" />
             </Form.Item>
             <Form.Item name="description" label="说明">

+ 1 - 1
src/pages/media/Device/index.tsx

@@ -285,7 +285,7 @@ const Device = () => {
                           ? '设备已禁用'
                           : '',
                     }
-                  : undefined
+                  : { title: '更新通道' }
               }
               key={'updateChannel'}
               isPermission={permission.update}

+ 14 - 8
src/pages/rule-engine/Scene/Save/components/Buttons/Dropdown.tsx

@@ -4,6 +4,7 @@ import classNames from 'classnames';
 import styles from './index.less';
 import { onlyMessage } from '@/utils/util';
 import { useOption } from '@/pages/rule-engine/Scene/Save/components/Buttons/index';
+import { FormModel } from '../..';
 
 type DropdownButtonOptions = {
   title: string;
@@ -92,13 +93,17 @@ const DropdownButton = (props: DropdownButtonProps) => {
 
   const DropdownRender = useMemo(() => {
     return (
-      <div className={styles['dropdown-content']}>
-        <Tree
-          selectedKeys={myValue ? [myValue] : []}
-          onSelect={treeSelect}
-          treeData={props.options}
-          fieldNames={props.fieldNames}
-        />
+      <div className={styles['dropdown-content']} style={{ background: '#fff', padding: '0 16px' }}>
+        {props.options.length !== 0 ? (
+          <Tree
+            selectedKeys={myValue ? [myValue] : []}
+            onSelect={treeSelect}
+            treeData={props.options}
+            fieldNames={props.fieldNames}
+          />
+        ) : (
+          <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
+        )}
       </div>
     );
   }, [props.options, myValue]);
@@ -142,7 +147,8 @@ const DropdownButton = (props: DropdownButtonProps) => {
       <div
         className={classNames(styles['dropdown-button'], props.className, typeClassName)}
         onClick={() => {
-          if (props.options.length === 0 && props.type !== 'termType') {
+          console.log(props.options, myValue, FormModel.current.trigger?.device);
+          if (!FormModel.current.trigger?.device && props.type !== 'termType') {
             onlyMessage('请先配置设备触发规则', 'warning');
           }
           if (props.options.length === 0 && props.type === 'termType') {

+ 7 - 0
src/pages/system/Apply/Save/index.less

@@ -42,5 +42,12 @@
       height: 100%;
       margin: 5px 20px 0 0;
     }
+
+    .ant-radio-button-wrapper-disabled.ant-radio-button-wrapper-checked {
+      color: rgba(0, 0, 0, 0.25);
+      background-color: #fff;
+      border-color: #1d39c4;
+      box-shadow: none;
+    }
   }
 }

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

@@ -1144,8 +1144,10 @@ const Save = () => {
         'x-component-props': {
           optionType: 'button',
           placeholder: '请选择应用',
+          disabled: !!id,
         },
         required: true,
+
         // 'x-reactions': '{{useAsyncDataSource(getProvidersAll)}}',
         'x-decorator-props': {
           gridSpan: 1,

+ 4 - 1
src/pages/system/Menu/Detail/edit.tsx

@@ -164,7 +164,10 @@ export default (props: EditProps) => {
                       defaultMessage: '编码',
                     })}
                     required={true}
-                    rules={[{ required: true, message: '请输入编码' }]}
+                    rules={[
+                      { required: true, message: '请输入编码' },
+                      { max: 64, message: '最多可输入64个字符' },
+                    ]}
                   >
                     <Input placeholder={'请输入编码'} />
                   </Form.Item>

Разлика између датотеке није приказан због своје велике величине
+ 455 - 245
src/pages/system/Menu/Setting/baseMenu.ts