hear 3 лет назад
Родитель
Сommit
13b388c686

+ 1 - 1
src/pages/media/Cascade/Channel/index.tsx

@@ -95,7 +95,7 @@ const Channel = () => {
       dataIndex: 'channelId',
       title: '国标ID',
       // ellipsis:true,
-      tooltip: '国标级联有18位、20位两种格式。在当前页面修改不会修改视频设备-通道页面中的国标ID',
+      tooltip: '国标级联有16位、20位两种格式。在当前页面修改不会修改视频设备-通道页面中的国标ID',
       render: (text: any, record: any) => (
         <div style={{ display: 'flex' }}>
           <Ellipsis title={record.gbChannelId || ''} />

+ 63 - 57
src/pages/media/Device/index.tsx

@@ -268,38 +268,42 @@ const Device = () => {
             <EyeOutlined />
           </Button>
         </Tooltip>,
-        <PermissionButton
-          tooltip={
-            record.state.value === 'offline' ||
-            record.state.value === 'notActive' ||
-            record.provider === 'fixed-media'
-              ? {
-                  title:
-                    record.provider === 'fixed-media'
-                      ? '固定地址无法更新通道'
-                      : record.state.value === 'offline'
-                      ? '设备已离线'
-                      : record.state.value === 'notActive'
-                      ? '设备已禁用'
-                      : '',
-                }
-              : undefined
-          }
-          key={'updateChannel'}
-          isPermission={permission.update}
-          disabled={
-            record.state.value === 'offline' ||
-            record.state.value === 'notActive' ||
-            record.provider === 'fixed-media'
-          }
-          style={{ padding: 0 }}
-          type={'link'}
-          onClick={() => {
-            updateChannel(record.id);
-          }}
-        >
-          <SyncOutlined />
-        </PermissionButton>,
+        <>
+          {record.provider !== 'fixed-media' && (
+            <PermissionButton
+              tooltip={
+                record.state.value === 'offline' ||
+                record.state.value === 'notActive' ||
+                record.provider === 'fixed-media'
+                  ? {
+                      title:
+                        record.provider === 'fixed-media'
+                          ? '固定地址无法更新通道'
+                          : record.state.value === 'offline'
+                          ? '设备已离线'
+                          : record.state.value === 'notActive'
+                          ? '设备已禁用'
+                          : '',
+                    }
+                  : undefined
+              }
+              key={'updateChannel'}
+              isPermission={permission.update}
+              disabled={
+                record.state.value === 'offline' ||
+                record.state.value === 'notActive' ||
+                record.provider === 'fixed-media'
+              }
+              style={{ padding: 0 }}
+              type={'link'}
+              onClick={() => {
+                updateChannel(record.id);
+              }}
+            >
+              <SyncOutlined />
+            </PermissionButton>
+          )}
+        </>,
         <PermissionButton
           key={'delete'}
           tooltip={{
@@ -422,31 +426,33 @@ const Device = () => {
                 <PartitionOutlined />
                 查看通道
               </Button>,
-              <PermissionButton
-                key={'updateChannel'}
-                isPermission={permission.update}
-                tooltip={
-                  record.state.value !== 'online' || record.provider === 'fixed-media'
-                    ? {
-                        title:
-                          record.provider === 'fixed-media'
-                            ? '固定地址无法更新通道'
-                            : record.state.value === 'offline'
-                            ? '设备已离线'
-                            : record.state.value === 'notActive'
-                            ? '设备已禁用'
-                            : '',
-                      }
-                    : undefined
-                }
-                disabled={record.state.value !== 'online' || record.provider === 'fixed-media'}
-                onClick={() => {
-                  updateChannel(record.id);
-                }}
-              >
-                <SyncOutlined />
-                更新通道
-              </PermissionButton>,
+              record.provider !== 'fixed-media' && (
+                <PermissionButton
+                  key={'updateChannel'}
+                  isPermission={permission.update}
+                  tooltip={
+                    record.state.value !== 'online' || record.provider === 'fixed-media'
+                      ? {
+                          title:
+                            record.provider === 'fixed-media'
+                              ? '固定地址无法更新通道'
+                              : record.state.value === 'offline'
+                              ? '设备已离线'
+                              : record.state.value === 'notActive'
+                              ? '设备已禁用'
+                              : '',
+                        }
+                      : undefined
+                  }
+                  disabled={record.state.value !== 'online' || record.provider === 'fixed-media'}
+                  onClick={() => {
+                    updateChannel(record.id);
+                  }}
+                >
+                  <SyncOutlined />
+                  更新通道
+                </PermissionButton>
+              ),
               <PermissionButton
                 key="delete"
                 popConfirm={{

+ 9 - 5
src/pages/rule-engine/Scene/Save/device/deviceList.tsx

@@ -46,6 +46,7 @@ export default observer(() => {
       dataIndex: 'productId',
       width: 200,
       ellipsis: true,
+      hideInSearch: true,
       valueType: 'select',
       request: async () => {
         const res = await service.getProductList();
@@ -58,11 +59,10 @@ export default observer(() => {
       filterMultiple: true,
     },
     {
-      title: intl.formatMessage({
-        id: 'pages.device.instance.registrationTime',
-        defaultMessage: '注册时间',
-      }),
-      dataIndex: 'registryTime',
+      title: '创建时间',
+      dataIndex: 'createTime',
+      width: '200px',
+      valueType: 'dateTime',
     },
     {
       title: intl.formatMessage({
@@ -102,6 +102,7 @@ export default observer(() => {
       title: '产品分类',
       valueType: 'treeSelect',
       hideInTable: true,
+      hideInSearch: true,
       fieldProps: {
         fieldNames: {
           label: 'name',
@@ -118,6 +119,7 @@ export default observer(() => {
     {
       title: '网关类型',
       dataIndex: 'accessProvider',
+      hideInSearch: true,
       width: 150,
       ellipsis: true,
       valueType: 'select',
@@ -145,6 +147,7 @@ export default observer(() => {
       dataIndex: 'productId$product-info',
       title: '接入方式',
       valueType: 'select',
+      hideInSearch: true,
       hideInTable: true,
       request: () =>
         service.queryGatewayList().then((resp: any) =>
@@ -159,6 +162,7 @@ export default observer(() => {
       title: '设备类型',
       valueType: 'select',
       hideInTable: true,
+      hideInSearch: true,
       valueEnum: {
         device: {
           text: '直连设备',

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

@@ -6,7 +6,6 @@ import { service } from '@/pages/system/Platforms';
 import { observer } from '@formily/react';
 import './index.less';
 import { useLocation } from 'umi';
-import { useDomFullHeight } from '@/hooks';
 import Home from '../Home';
 import { ApiModel } from '@/pages/system/Platforms/Api/base';
 
@@ -28,7 +27,6 @@ export default observer((props: ApiPageProps) => {
   const location = useLocation();
   const [operations, setOperations] = useState<string[] | undefined>(undefined);
   const [GrantKeys, setGrantKeys] = useState<string[] | undefined>(undefined);
-  const { minHeight } = useDomFullHeight(`.platforms-api`);
 
   const initModel = () => {
     ApiModel.data = [];
@@ -83,7 +81,7 @@ export default observer((props: ApiPageProps) => {
   console.log(ApiModel.showTable);
 
   return (
-    <div className={'platforms-api'} style={{ minHeight }}>
+    <div className={'platforms-api'}>
       <div className={'platforms-api-tree'}>
         <Tree
           isShowGranted={props.isShowGranted}

+ 1 - 0
src/pages/system/Apply/Api/index.less

@@ -25,6 +25,7 @@
 
   .platforms-api-swagger {
     flex: 1;
+    min-width: 0;
     margin-left: 24px;
 
     .platforms-api-swagger-back {

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

@@ -21,7 +21,7 @@ import { TreeSelect as ATreeSelect } from 'antd';
 import { useEffect, useRef, useState } from 'react';
 import { createSchemaField } from '@formily/react';
 import { createForm, Field, onFieldReact, onFieldValueChange, onFormInit } from '@formily/core';
-import { onlyMessage, randomString, useAsyncDataSource } from '@/utils/util';
+import { onlyMessage, randomString, testIP, useAsyncDataSource } from '@/utils/util';
 import { service } from '../index';
 import { PlusOutlined } from '@ant-design/icons';
 import { action } from '@formily/reactive';
@@ -248,13 +248,9 @@ const Save = () => {
       });
       onFieldReact('apiServer.ipWhiteList', (field: any) => {
         const value = (field as Field).value;
-        const pattern =
-          /((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/;
         if (value) {
           const str = value?.split(/[\n,]/g).filter((i: any) => i && i.trim());
-          // console.log(str);
-          const NoIP = str.find((item: any) => !pattern.test(item));
-          console.log(NoIP);
+          const NoIP = str.find((item: any) => !testIP(item.replace(/\s*/g, '')));
           if (NoIP) {
             field.selfErrors = `[${NoIP}]不是正确的IP地址`;
           } else {

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

@@ -181,7 +181,7 @@ export default (props: EditProps) => {
                     required={true}
                     rules={[
                       { required: true, message: '请输入页面地址' },
-                      { max: 120, message: '最多可输入120字符' },
+                      { max: 128, message: '最多可输入128字符' },
                     ]}
                   >
                     <Input placeholder={'请输入页面地址'} />