sun-chaochao 3 lat temu
rodzic
commit
5531f6be6e

+ 1 - 1
src/components/FRuleEditor/Operator/index.tsx

@@ -28,7 +28,7 @@ const Operator = () => {
         description: `### ${p.name}
         \n 数据类型: ${p.valueType?.type}
         \n 是否只读: ${p.expands?.readOnly || 'false'}
-        \n 可写数值范围: ---`,
+        \n 可写数值范围: `,
         type: 'property',
       })),
     };

+ 2 - 2
src/components/ProTableCard/CardItems/aliyun.tsx

@@ -36,11 +36,11 @@ export default (props: AliyunCardProps) => {
           <div className={'card-item-content'}>
             <div>
               <label>网桥产品</label>
-              <div className={'ellipsis'}>{props?.bridgeProductName || '--'}</div>
+              <div className={'ellipsis'}>{props?.bridgeProductName || ''}</div>
             </div>
             <div>
               <label>说明</label>
-              <div className={'ellipsis'}>{props?.description || '--'}</div>
+              <div className={'ellipsis'}>{props?.description || ''}</div>
             </div>
           </div>
         </div>

+ 2 - 2
src/components/ProTableCard/CardItems/device.tsx

@@ -148,11 +148,11 @@ export default (props: DeviceCardProps) => {
           <div className={'card-item-content'}>
             <div>
               <label>设备类型</label>
-              <div className={'ellipsis'}>{props.deviceType ? props.deviceType.text : '--'}</div>
+              <div className={'ellipsis'}>{props.deviceType ? props.deviceType.text : ''}</div>
             </div>
             <div>
               <label>产品名称</label>
-              <div className={'ellipsis'}>{props.productName || '--'}</div>
+              <div className={'ellipsis'}>{props.productName || ''}</div>
             </div>
           </div>
         </div>

+ 4 - 4
src/components/ProTableCard/CardItems/mediaDevice.tsx

@@ -38,19 +38,19 @@ export default (props: ProductCardProps) => {
           <div className={'card-item-content'}>
             <div>
               <label>厂商</label>
-              <div className={'ellipsis'}>{props.manufacturer || '--'}</div>
+              <div className={'ellipsis'}>{props.manufacturer || ''}</div>
             </div>
             <div>
               <label>通道数量</label>
-              <div className={'ellipsis'}>{props.channelNumber || '--'}</div>
+              <div className={'ellipsis'}>{props.channelNumber || ''}</div>
             </div>
             <div>
               <label>型号</label>
-              <div className={'ellipsis'}>{props.model || '--'}</div>
+              <div className={'ellipsis'}>{props.model || ''}</div>
             </div>
             <div>
               <label>接入方式</label>
-              <div className={'ellipsis'}>{props.provider || '--'}</div>
+              <div className={'ellipsis'}>{props.provider || ''}</div>
             </div>
           </div>
         </div>

+ 1 - 1
src/components/ProTableCard/CardItems/scene.tsx

@@ -48,7 +48,7 @@ export default (props: DeviceCardProps) => {
             </div>
             <div>
               <label>说明</label>
-              <div className={'ellipsis'}>{props.description || '--'}</div>
+              <div className={'ellipsis'}>{props.description || ''}</div>
             </div>
           </div>
         </div>

+ 1 - 1
src/pages/Log/System/index.tsx

@@ -71,7 +71,7 @@ const System = () => {
       dataIndex: 'context.server',
       width: 150,
       ellipsis: true,
-      render: (text, record) => record?.context?.server || '--',
+      render: (text, record) => record?.context?.server || '',
     },
     {
       title: intl.formatMessage({

+ 5 - 5
src/pages/account/NotificationRecord/detail/index.tsx

@@ -34,15 +34,15 @@ const Detail = (props: Props) => {
         {data?.targetType === 'device' && (
           <>
             <Descriptions.Item label="告警设备" span={1}>
-              {data?.targetName || '--'}
+              {data?.targetName || ''}
             </Descriptions.Item>
             <Descriptions.Item label="设备ID" span={1}>
-              {data?.targetId || '--'}
+              {data?.targetId || ''}
             </Descriptions.Item>
           </>
         )}
         <Descriptions.Item label="告警名称" span={1}>
-          {data?.alarmName || '--'}
+          {data?.alarmName || ''}
         </Descriptions.Item>
         <Descriptions.Item label="告警时间" span={1}>
           {moment(data?.alarmTime).format('YYYY-MM-DD HH:mm:ss')}
@@ -52,10 +52,10 @@ const Detail = (props: Props) => {
             ?.title || data?.level}
         </Descriptions.Item>
         <Descriptions.Item label="告警说明" span={1}>
-          {data?.description || '--'}
+          {data?.description || ''}
         </Descriptions.Item>
         <Descriptions.Item label="告警流水" span={2}>
-          {data?.alarmInfo || '--'}
+          {data?.alarmInfo || ''}
         </Descriptions.Item>
       </Descriptions>
     </Modal>

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

@@ -64,7 +64,7 @@ const Config = () => {
       if (isExit(item.property)) {
         return (
           <div>
-            <span style={{ marginRight: '10px' }}>{config[item.property] || '--'}</span>
+            <span style={{ marginRight: '10px' }}>{config[item.property] || ''}</span>
             <Tooltip title={`有效值:${config[item.property]}`}>
               <QuestionCircleOutlined />
             </Tooltip>
@@ -73,16 +73,16 @@ const Config = () => {
       } else {
         return (
           <div>
-            <Tooltip title={config[item.property] || '--'} placement="topLeft">
+            <Tooltip title={config[item.property] || ''} placement="topLeft">
               <div className="ellipsis" style={{ width: 300 }}>
-                {config[item.property] || '--'}
+                {config[item.property] || ''}
               </div>
             </Tooltip>
           </div>
         );
       }
     } else {
-      return '--';
+      return '';
     }
   };
 

+ 1 - 1
src/pages/device/Instance/Detail/Info/index.tsx

@@ -118,7 +118,7 @@ const Info = observer(() => {
           >
             {InstanceModel.detail?.onlineTime
               ? moment(InstanceModel.detail?.onlineTime).format('YYYY-MM-DD HH:mm:ss')
-              : '--'}
+              : ''}
           </Descriptions.Item>
           <Descriptions.Item
             label={intl.formatMessage({

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

@@ -58,11 +58,11 @@ const Reation = () => {
         {(data || [])?.map((item: any) => (
           <Descriptions.Item span={1} label={item.relationName} key={item.objectId}>
             <Tooltip
-              title={item?.related ? _.map(item?.related || [], 'name').join(',') : '--'}
+              title={item?.related ? _.map(item?.related || [], 'name').join(',') : ''}
               placement="topLeft"
             >
               <div className="ellipsis" style={{ width: 300 }}>
-                {item?.related ? _.map(item?.related || [], 'name').join(',') : '--'}
+                {item?.related ? _.map(item?.related || [], 'name').join(',') : ''}
               </div>
             </Tooltip>
           </Descriptions.Item>

+ 3 - 1
src/pages/device/Instance/Detail/Running/Property/FileComponent/index.tsx

@@ -33,7 +33,9 @@ const FileComponent = (props: Props) => {
 
   const renderValue = () => {
     if (value?.formatValue !== 0 && !value?.formatValue) {
-      return <div className={props.type === 'card' ? styles.cardValue : styles.otherValue}>--</div>;
+      return (
+        <div className={props.type === 'card' ? styles.cardValue : styles.otherValue}>{''}</div>
+      );
     } else if (data?.valueType?.type === 'file') {
       if (
         data?.valueType?.fileType === 'base64' ||

+ 1 - 1
src/pages/device/Instance/Detail/Running/Property/PropertyCard.tsx

@@ -105,7 +105,7 @@ const Property = (props: Props) => {
           <div style={{ marginTop: 10 }}>
             <div style={{ color: 'rgba(0, 0, 0, .65)', fontSize: 12 }}>更新时间</div>
             <div style={{ marginTop: 5, fontSize: 16, color: 'black' }} className="value">
-              {value?.timestamp ? moment(value?.timestamp).format('YYYY-MM-DD HH:mm:ss') : '--'}
+              {value?.timestamp ? moment(value?.timestamp).format('YYYY-MM-DD HH:mm:ss') : ''}
             </div>
           </div>
         </div>

+ 1 - 1
src/pages/device/Instance/Detail/Running/Property/index.tsx

@@ -288,7 +288,7 @@ const Property = (props: Props) => {
               <Row gutter={[16, 16]}>
                 {dataSource.data.map((item: any) => (
                   <Col {...ColResponsiveProps} key={item.id}>
-                    <PropertyCard data={item} value={item?.id ? propertyValue[item?.id] : '--'} />
+                    <PropertyCard data={item} value={item?.id ? propertyValue[item?.id] : ''} />
                   </Col>
                 ))}
               </Row>

+ 2 - 2
src/pages/device/Instance/Detail/Tags/index.tsx

@@ -45,9 +45,9 @@ const Tags = () => {
       >
         {(tags || [])?.map((item: any) => (
           <Descriptions.Item span={1} label={`${item.name}(${item.key})`} key={item.key}>
-            <Tooltip title={item.value || '--'} placement="topLeft">
+            <Tooltip title={item.value || ''} placement="topLeft">
               <div className="ellipsis" style={{ width: 300 }}>
-                {item.value || '--'}{' '}
+                {item.value || ''}{' '}
               </div>
             </Tooltip>
           </Descriptions.Item>

+ 1 - 0
src/pages/device/Instance/typings.d.ts

@@ -41,6 +41,7 @@ export type DeviceInstance = {
   photoUrl: string;
   independentMetadata?: boolean;
   accessProvider?: string;
+  accessId?: string;
 };
 
 type Unit = {

+ 3 - 3
src/pages/link/AccessConfig/Detail/Channel/index.tsx

@@ -109,11 +109,11 @@ const Media = (props: Props) => {
             <div style={{ marginLeft: 10 }}>
               <TitleComponent data={'配置概览'} />
               <div>
-                <p>接入方式:{props.provider?.name || '--'}</p>
-                {props.provider?.description && <p>{props.provider?.description || '--'}</p>}
+                <p>接入方式:{props.provider?.name || ''}</p>
+                {props.provider?.description && <p>{props.provider?.description || ''}</p>}
                 <p>消息协议:{procotol}</p>
                 {config?.document && (
-                  <div>{<ReactMarkdown>{config?.document}</ReactMarkdown> || '--'}</div>
+                  <div>{<ReactMarkdown>{config?.document}</ReactMarkdown> || ''}</div>
                 )}
               </div>
               <TitleComponent data={'设备接入指引'} />

+ 3 - 3
src/pages/link/AccessConfig/Detail/Cloud/Finish/index.tsx

@@ -101,11 +101,11 @@ const Finish = (props: Props) => {
         <div style={{ marginLeft: 10 }}>
           <TitleComponent data={'配置概览'} />
           <div>
-            <p>接入方式:{props.provider?.name || '--'}</p>
-            {props.provider?.description && <p>{props.provider?.description || '--'}</p>}
+            <p>接入方式:{props.provider?.name || ''}</p>
+            {props.provider?.description && <p>{props.provider?.description || ''}</p>}
             <p>消息协议:{props.procotol}</p>
             {config?.document && (
-              <div>{<ReactMarkdown>{config?.document}</ReactMarkdown> || '--'}</div>
+              <div>{<ReactMarkdown>{config?.document}</ReactMarkdown> || ''}</div>
             )}
           </div>
           <TitleComponent data={'设备接入指引'} />

+ 2 - 2
src/pages/link/AccessConfig/Detail/Cloud/Protocol/index.tsx

@@ -99,8 +99,8 @@ const Protocol = (props: Props) => {
                 }}
               >
                 <div style={{ height: '45px' }}>
-                  <div className={styles.title}>{item.name || '--'}</div>
-                  <div className={styles.desc}>{item.description || '--'}</div>
+                  <div className={styles.title}>{item.name || ''}</div>
+                  <div className={styles.desc}>{item.description || ''}</div>
                 </div>
               </Card>
             </Col>

+ 3 - 0
src/pages/link/Protocol/FileUpload/index.tsx

@@ -51,6 +51,9 @@ const FileUpload = connect((props: Props) => {
               e.stopPropagation();
             }}
             placeholder="请上传文件"
+            onBlur={(e) => {
+              props.onChange(e.target.value);
+            }}
           />
           <Button
             disabled={props?.disabled}

+ 48 - 56
src/pages/link/Protocol/save/index.tsx

@@ -87,50 +87,50 @@ const Save = (props: Props) => {
           columnGap: 24,
         },
         properties: {
-          id: {
-            title: 'ID',
-            'x-component': 'Input',
-            'x-decorator': 'FormItem',
-            'x-disabled': !!props.data?.id,
-            'x-decorator-props': {
-              gridSpan: 2,
-            },
-            'x-validator': [
-              {
-                required: true,
-                message: '请输入ID',
-              },
-              {
-                max: 64,
-                message: '最多可输入64个字符',
-              },
-              {
-                validateId: true,
-                message: 'ID只能由数字、26个英文字母或者下划线组成',
-              },
-              {
-                triggerType: 'onBlur',
-                validator: (value: string) => {
-                  if (!value) return;
-                  return new Promise((resolve) => {
-                    service
-                      .validator(value)
-                      .then((resp) => {
-                        if (!!resp?.result) {
-                          resolve('ID已存在');
-                        } else {
-                          resolve('');
-                        }
-                      })
-                      .catch(() => '验证失败!');
-                  });
-                },
-              },
-            ],
-            'x-component-props': {
-              placeholder: '请输入ID',
-            },
-          },
+          // id: {
+          //   title: 'ID',
+          //   'x-component': 'Input',
+          //   'x-decorator': 'FormItem',
+          //   'x-disabled': !!props.data?.id,
+          //   'x-decorator-props': {
+          //     gridSpan: 2,
+          //   },
+          //   'x-validator': [
+          //     {
+          //       required: true,
+          //       message: '请输入ID',
+          //     },
+          //     {
+          //       max: 64,
+          //       message: '最多可输入64个字符',
+          //     },
+          //     {
+          //       validateId: true,
+          //       message: 'ID只能由数字、26个英文字母或者下划线组成',
+          //     },
+          //     {
+          //       triggerType: 'onBlur',
+          //       validator: (value: string) => {
+          //         if (!value) return;
+          //         return new Promise((resolve) => {
+          //           service
+          //             .validator(value)
+          //             .then((resp) => {
+          //               if (!!resp?.result) {
+          //                 resolve('ID已存在');
+          //               } else {
+          //                 resolve('');
+          //               }
+          //             })
+          //             .catch(() => '验证失败!');
+          //         });
+          //       },
+          //     },
+          //   ],
+          //   'x-component-props': {
+          //     placeholder: '请输入ID',
+          //   },
+          // },
           name: {
             title: '名称',
             'x-component': 'Input',
@@ -242,19 +242,11 @@ const Save = (props: Props) => {
     },
   };
 
-  const save = async (deploy: boolean) => {
+  const save = async () => {
     const value = await form.submit<ProtocolItem>();
-    let response = undefined;
-    if (!props.data?.id) {
-      response = await service.save(value);
-    } else {
-      response = await service.update(value);
-    }
-    if (response && response.status === 200) {
+    const response: any = await service.savePatch({ ...props.data, ...value });
+    if (response && response?.status === 200) {
       onlyMessage('操作成功');
-      if (deploy) {
-        await service.modifyState(value.id, 'deploy');
-      }
       props.reload();
       if ((window as any).onTabSaveSuccess) {
         (window as any).onTabSaveSuccess(response);
@@ -278,7 +270,7 @@ const Save = (props: Props) => {
           type="primary"
           key={2}
           onClick={() => {
-            save(false);
+            save();
           }}
           disabled={props.data?.id ? !permission.update : !permission.add}
         >

+ 5 - 5
src/pages/media/Device/Save/ProviderSelect.tsx

@@ -113,12 +113,12 @@ export default (props: ProviderProps) => {
                 </div>
                 <div className={styles.card}>
                   <div className={styles.header}>
-                    <div className={styles.title}>{item.name || '--'}</div>
-                    <div className={styles.desc}>{item.description || '--'}</div>
+                    <div className={styles.title}>{item.name || ''}</div>
+                    <div className={styles.desc}>{item.description || ''}</div>
                   </div>
                   <div className={styles.container}>
                     <div className={styles.server}>
-                      <div className={styles.subTitle}>{item?.channelInfo?.name || '--'}</div>
+                      <div className={styles.subTitle}>{item?.channelInfo?.name || ''}</div>
                       <div style={{ width: '100%' }}>
                         {item.channelInfo?.addresses.map((i: any, index: number) => (
                           <p key={i.address + `_address${index}`}>
@@ -128,8 +128,8 @@ export default (props: ProviderProps) => {
                       </div>
                     </div>
                     <div className={styles.procotol}>
-                      <div className={styles.subTitle}>{item?.protocolDetail?.name || '--'}</div>
-                      <p>{item.protocolDetail?.description || '--'}</p>
+                      <div className={styles.subTitle}>{item?.protocolDetail?.name || ''}</div>
+                      <p>{item.protocolDetail?.description || ''}</p>
                     </div>
                   </div>
                 </div>

+ 1 - 1
src/pages/notice/Config/SyncUser/index.tsx

@@ -45,7 +45,7 @@ const SyncUser = observer(() => {
       dataIndex: 'userId',
       title: `用户`,
       render: (text: any, record: any) => (
-        <span>{record?.userId ? `${record?.userName}(${record?.username})` : '--'}</span>
+        <span>{record?.userId ? `${record?.userName}(${record?.username})` : ''}</span>
       ),
     },
     {

+ 5 - 5
src/pages/rule-engine/Alarm/Log/Detail/Info.tsx

@@ -29,15 +29,15 @@ const Info = (props: Props) => {
         {data.targetType === 'device' && (
           <>
             <Descriptions.Item label="告警设备" span={1}>
-              {data?.targetName || '--'}
+              {data?.targetName || ''}
             </Descriptions.Item>
             <Descriptions.Item label="设备ID" span={1}>
-              {data?.targetId || '--'}
+              {data?.targetId || ''}
             </Descriptions.Item>
           </>
         )}
         <Descriptions.Item label="告警名称" span={1}>
-          {data?.alarmConfigName || '--'}
+          {data?.alarmConfigName || ''}
         </Descriptions.Item>
         <Descriptions.Item label="告警时间" span={1}>
           {moment(data?.alarmTime).format('YYYY-MM-DD HH:mm:ss')}
@@ -47,10 +47,10 @@ const Info = (props: Props) => {
             ?.title || data?.level}
         </Descriptions.Item>
         <Descriptions.Item label="告警说明" span={1}>
-          {data?.description || '--'}
+          {data?.description || ''}
         </Descriptions.Item>
         <Descriptions.Item label="告警流水" span={2}>
-          {data?.alarmInfo || '--'}
+          {data?.alarmInfo || ''}
         </Descriptions.Item>
       </Descriptions>
     </Modal>