Ver código fonte

feat(product): merge sc

fix: 修改产品数量
Lind 3 anos atrás
pai
commit
fec8bcbf96

+ 1 - 1
src/locales/zh-CN/pages.ts

@@ -253,7 +253,7 @@ export default {
   'pages.device.instance.status.onLine': '在线',
   'pages.device.instance.deleteTip': '已启用的设备无法删除',
   'pages.device.instanceDetail.deviceType': '设备类型',
-  'pages.device.instanceDetail.transportProtocol': '接协议',
+  'pages.device.instanceDetail.transportProtocol': '接协议',
   'pages.device.instanceDetail.protocolName': '消息协议',
   'pages.device.instanceDetail.createTime': '创建时间',
   'pages.device.instanceDetail.registerTime': '注册时间',

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

@@ -54,7 +54,7 @@ const Info = observer(() => {
           <Descriptions.Item
             label={intl.formatMessage({
               id: 'pages.device.instanceDetail.transportProtocol',
-              defaultMessage: '接协议',
+              defaultMessage: '接协议',
             })}
           >
             {InstanceModel.detail?.protocolName}

+ 4 - 1
src/pages/device/Product/Detail/BaseInfo/index.tsx

@@ -68,7 +68,10 @@ const BaseInfo = () => {
   const getDetailInfo = () => {
     service.getProductDetail(id || '').subscribe((data) => {
       if (data) {
-        productModel.current = data;
+        productModel.current = {
+          ...productModel.current,
+          ...data,
+        };
       }
     });
   };

+ 36 - 24
src/pages/link/Protocol/index.tsx

@@ -106,33 +106,45 @@ const Protocol = () => {
             </Popconfirm>
           </a>
         ),
-        <Button key="delete" type="link" disabled={record.state !== 1}>
-          <Popconfirm
-            title={intl.formatMessage({
-              id: 'pages.data.option.remove.tips',
-              defaultMessage: '确认删除?',
-            })}
-            onConfirm={async () => {
-              await service.remove(record.id);
-              message.success(
-                intl.formatMessage({
-                  id: 'pages.data.option.success',
-                  defaultMessage: '操作成功!',
-                }),
-              );
-              actionRef.current?.reload();
-            }}
-          >
-            <Tooltip
+        <Tooltip
+          key="delete"
+          title={
+            record.state !== 1
+              ? intl.formatMessage({
+                  id: 'pages.data.option.remove',
+                  defaultMessage: '删除',
+                })
+              : '请先禁用该组件,再删除。'
+          }
+        >
+          <Button style={{ padding: 0 }} key="delete" type="link" disabled={record.state !== 1}>
+            <Popconfirm
               title={intl.formatMessage({
-                id: 'pages.data.option.remove',
-                defaultMessage: '删除',
+                id: 'pages.data.option.remove.tips',
+                defaultMessage: '确认删除?',
               })}
+              onConfirm={async () => {
+                await service.remove(record.id);
+                message.success(
+                  intl.formatMessage({
+                    id: 'pages.data.option.success',
+                    defaultMessage: '操作成功!',
+                  }),
+                );
+                actionRef.current?.reload();
+              }}
             >
-              <DeleteOutlined />
-            </Tooltip>
-          </Popconfirm>
-        </Button>,
+              <Tooltip
+                title={intl.formatMessage({
+                  id: 'pages.data.option.remove',
+                  defaultMessage: '删除',
+                })}
+              >
+                <DeleteOutlined />
+              </Tooltip>
+            </Popconfirm>
+          </Button>
+        </Tooltip>,
       ],
     },
   ];