100011797 пре 3 година
родитељ
комит
19a0dd1122

+ 6 - 0
src/pages/device/Instance/Save/index.tsx

@@ -16,6 +16,8 @@ interface Props {
   data?: Partial<DeviceInstance>;
 }
 
+const defaultImage = require('/public/images/device-type-3-big.png');
+
 const Save = (props: Props) => {
   const { visible, close, data } = props;
   const [productList, setProductList] = useState<any[]>([]);
@@ -27,6 +29,10 @@ const Save = (props: Props) => {
       form.setFieldsValue({
         ...data,
       });
+    } else if (visible) {
+      form.setFieldsValue({
+        photoUrl: defaultImage,
+      });
     }
   }, [visible]);
 

+ 12 - 4
src/pages/device/Product/Save/index.tsx

@@ -17,6 +17,8 @@ interface Props {
   model: 'add' | 'edit';
 }
 
+const defaultImage = require('/public/images/device-product.png');
+
 const Save = (props: Props) => {
   const { visible, close, data } = props;
   const intl = useIntl();
@@ -31,13 +33,19 @@ const Save = (props: Props) => {
   });
 
   const handleData = () => {
+    const obj = { ...data };
     // 特殊处理deviceType字段
-    if (data) {
-      if (typeof data.deviceType !== 'string') {
-        data.deviceTypeId = data.deviceType?.value;
+    if (obj) {
+      if (typeof obj.deviceType !== 'string') {
+        obj.deviceTypeId = obj.deviceType?.value;
+        obj.photoUrl = obj?.photoUrl || defaultImage;
       }
+    } else {
+      return {
+        photoUrl: defaultImage,
+      };
     }
-    return data;
+    return obj;
   };
 
   const intlFormat = (

+ 9 - 1
src/pages/link/DataCollect/components/Channel/index.tsx

@@ -140,11 +140,19 @@ export default observer((props: Props) => {
                             isPermission={permission.delete}
                             type={'link'}
                             style={{ padding: 0 }}
+                            disabled={record?.state?.value !== 'disabled'}
+                            tooltip={
+                              record?.state?.value !== 'disabled'
+                                ? {
+                                    title: '正常的通道不能删除',
+                                  }
+                                : undefined
+                            }
                             popConfirm={{
                               title: intl.formatMessage({
                                 id: 'pages.data.option.remove.tips',
+                                defaultMessage: '是否删除?',
                               }),
-                              disabled: record?.state?.value !== 'disabled',
                               onConfirm: async () => {
                                 await service.removeChannel(record.id);
                                 onlyMessage(

+ 1 - 3
src/pages/link/DataCollect/components/Device/index.tsx

@@ -206,9 +206,7 @@ export default observer((props: Props) => {
                             tooltip={
                               record?.state?.value !== 'disabled'
                                 ? {
-                                    title: intl.formatMessage({
-                                      id: 'pages.device.instance.deleteTip',
-                                    }),
+                                    title: '正常的采集器不能删除',
                                   }
                                 : undefined
                             }

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

@@ -103,7 +103,7 @@ export default () => {
       ellipsis: true,
     },
     {
-      dataIndex: 'state',
+      dataIndex: 'status',
       width: 90,
       title: intl.formatMessage({
         id: 'pages.searchTable.titleStatus',

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

@@ -12,6 +12,7 @@ import styles from '../../Cascade/Save/index.less';
 import { useDomFullHeight } from '@/hooks';
 
 const DefaultAccessType = 'gb28181-2016';
+const defaultImage = require('/public/images/device-media.png');
 
 const Save = () => {
   const location: any = useLocation();
@@ -49,7 +50,10 @@ const Save = () => {
     if (id) {
       service.getDetail(id).then((res) => {
         if (res.status === 200) {
-          form.setFieldsValue(res.result);
+          form.setFieldsValue({
+            ...res.result,
+            photoUrl: res.result?.photoUrl || defaultImage,
+          });
           const _accessType = res.result?.provider || DefaultAccessType;
           setAccessType(_accessType);
           queryProduct(_accessType);
@@ -59,6 +63,7 @@ const Save = () => {
     } else {
       form.setFieldsValue({
         provider: DefaultAccessType,
+        photoUrl: defaultImage,
       });
       queryProduct(DefaultAccessType);
       setAccessType(DefaultAccessType);

+ 1 - 1
src/pages/notice/Config/Detail/doc/AliyunVoice.tsx

@@ -20,7 +20,7 @@ const AliyunVoice = () => {
       <div>
         <h2>1、RegionID</h2>
         <div>
-          阿里云内部给每台机器设置的唯一编号。请根据购买的阿里云服务器阿里云地域和可用区对照表地址:https://help.aliyun.com/document_detail/40654.html?spm=a2c6h.13066369.0.0.54a174710O7rWH获取路径:“微信公众平台”管理后台--“设置与开发”--“基本配置”
+          阿里云内部给每台机器设置的唯一编号。请根据购买的阿里云服务器阿里云地域和可用区对照表地址:https://help.aliyun.com/document_detail/40654.html?spm=a2c6h.13066369.0.0.54a174710O7rWH
         </div>
       </div>
       <h2>2、AccesskeyID/Secret</h2>