wzyyy 3 лет назад
Родитель
Сommit
44e92f7942

+ 4 - 4
config/proxy.ts

@@ -12,11 +12,11 @@ export default {
       // target: 'http://192.168.32.44:8844/',
       // ws: 'ws://192.168.32.44:8844/',
       // 开发环境
-      target: 'http://120.79.18.123:8844/',
-      ws: 'ws://120.79.18.123:8844/',
+      // target: 'http://120.79.18.123:8844/',
+      // ws: 'ws://120.79.18.123:8844/',
       // 测试环境
-      // target: 'http://120.77.179.54:8844/',
-      // ws: 'ws://120.77.179.54:8844/',
+      target: 'http://120.77.179.54:8844/',
+      ws: 'ws://120.77.179.54:8844/',
       // target: 'http://192.168.66.5:8844/',
       // ws: 'ws://192.168.66.5:8844/',
       // ws: 'ws://demo.jetlinks.cn/jetlinks',

+ 0 - 9
src/pages/account/Center/edit/passwordEdit.tsx

@@ -210,19 +210,10 @@ const PasswordEdit = (props: Props) => {
       onOk={async () => {
         const value: { oldPassword: string; newPassword: string; confirmPassword: string } =
           await form.submit();
-        console.log(value);
         props.save({
           oldPassword: value.oldPassword,
           newPassword: value.newPassword,
         });
-        // if (props.data.id) {
-        //   const resp = await service.resetPassword(props.data.id, value.confirmPassword);
-        //   if (resp.status === 200) {
-        //     message.success('操作成功');
-        //     props.close();
-        //   }
-        // }
-        // props.close();
       }}
     >
       <Form form={form} layout="vertical">

+ 1 - 0
src/pages/account/Center/index.tsx

@@ -320,6 +320,7 @@ const Center = () => {
         <PasswordEdit
           save={(item: any) => {
             savePassword(item);
+            setPassword(false);
           }}
           visible={password}
           close={() => {

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

@@ -224,6 +224,7 @@ const Modbus = () => {
         <div style={{ display: 'flex' }}>
           <div>
             <Tabs
+              style={{ height: 600 }}
               tabPosition={'left'}
               defaultActiveKey={opcId}
               onChange={(e) => {

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

@@ -240,6 +240,7 @@ const Opcua = () => {
         <div style={{ display: 'flex' }}>
           <div>
             <Tabs
+              style={{ height: 600 }}
               tabPosition={'left'}
               defaultActiveKey={opcId}
               onChange={(e) => {

+ 10 - 1
src/pages/link/Channel/Modbus/Access/bindDevice/index.tsx

@@ -28,14 +28,20 @@ const BindDevice = (props: Props) => {
     {
       title: '设备ID',
       dataIndex: 'id',
+      width: 200,
+      ellipsis: true,
     },
     {
       title: '设备名称',
       dataIndex: 'name',
+      width: 200,
+      ellipsis: true,
     },
     {
       title: '产品名称',
       dataIndex: 'productName',
+      width: 200,
+      ellipsis: true,
     },
     {
       title: '注册时间',
@@ -80,7 +86,10 @@ const BindDevice = (props: Props) => {
       <SearchComponent
         field={columns}
         target="bindDevice"
-        defaultParam={[{ column: 'id$modbus-master$not', value: props.id }]}
+        defaultParam={[
+          { column: 'id$modbus-master$not', value: props.id },
+          { column: 'productId$dev-protocol', value: 'modbus-tcp' },
+        ]}
         onSearch={(data) => {
           // 重置分页数据
           actionRef.current?.reset?.();

+ 4 - 0
src/pages/link/Channel/Modbus/Access/index.less

@@ -8,6 +8,10 @@
     .ant-tabs-content-holder {
       width: 1px;
     }
+    .ant-tabs > .ant-tabs-nav .ant-tabs-nav-more,
+    .ant-tabs > div > .ant-tabs-nav .ant-tabs-nav-more {
+      display: none;
+    }
   }
 }
 

+ 1 - 0
src/pages/link/Channel/Modbus/Access/index.tsx

@@ -235,6 +235,7 @@ const Access = () => {
           <div style={{ display: 'flex' }}>
             <div>
               <Tabs
+                style={{ height: 600 }}
                 tabPosition={'left'}
                 defaultActiveKey={deviceId}
                 onChange={(e) => {

+ 17 - 0
src/pages/link/Channel/Modbus/index.tsx

@@ -47,6 +47,8 @@ const Modbus = () => {
     {
       title: '端口',
       dataIndex: 'port',
+      search: false,
+      valueType: 'digit',
     },
     {
       title: '状态',
@@ -54,6 +56,21 @@ const Modbus = () => {
       renderText: (state) => (
         <Badge text={state?.text} status={state?.value === 'disabled' ? 'error' : 'success'} />
       ),
+      valueType: 'select',
+      valueEnum: {
+        disabled: {
+          text: intl.formatMessage({
+            id: 'pages.data.option.disabled',
+            defaultMessage: '禁用',
+          }),
+          status: 'disabled',
+        },
+        enabled: {
+          text: '正常',
+          status: 'enabled',
+        },
+      },
+      filterMultiple: false,
     },
     {
       title: '操作',

+ 2 - 0
src/pages/link/Channel/Opcua/Access/bindDevice/index.tsx

@@ -33,6 +33,8 @@ const BindDevice = (props: Props) => {
     {
       title: '设备名称',
       dataIndex: 'name',
+      width: 200,
+      ellipsis: true,
     },
     {
       title: '产品名称',

+ 4 - 1
src/pages/link/Channel/Opcua/Access/index.less

@@ -4,10 +4,13 @@
       color: #1d39c4;
       text-shadow: none;
     }
-
     .ant-tabs-content-holder {
       width: 1px;
     }
+    .ant-tabs > .ant-tabs-nav .ant-tabs-nav-more,
+    .ant-tabs > div > .ant-tabs-nav .ant-tabs-nav-more {
+      display: none;
+    }
   }
 }
 

+ 1 - 0
src/pages/link/Channel/Opcua/Access/index.tsx

@@ -234,6 +234,7 @@ const Access = () => {
               <Tabs
                 tabPosition={'left'}
                 defaultActiveKey={deviceId}
+                style={{ height: 600 }}
                 onChange={(e) => {
                   setDeviceId(e);
                   const items = bindList.find((item: any) => item.deviceId === e);

+ 38 - 9
src/pages/link/Channel/Opcua/index.tsx

@@ -52,9 +52,27 @@ const Opcua = () => {
     {
       title: '状态',
       dataIndex: 'state',
+      valueType: 'select',
       renderText: (state) => (
         <Badge text={state?.text} status={state?.value === 'disabled' ? 'error' : 'success'} />
       ),
+      valueEnum: {
+        disabled: {
+          text: intl.formatMessage({
+            id: 'pages.data.option.disabled',
+            defaultMessage: '禁用',
+          }),
+          status: 'disabled',
+        },
+        enabled: {
+          text: intl.formatMessage({
+            id: 'pages.data.option.enabled',
+            defaultMessage: '启用',
+          }),
+          status: 'enabled',
+        },
+      },
+      filterMultiple: false,
     },
     {
       title: '操作',
@@ -93,17 +111,28 @@ const Opcua = () => {
             }),
             onConfirm: async () => {
               if (record.state.value === 'disabled') {
-                await service.enable(record.id);
+                const res = await service.enable(record.id);
+                if (res.status === 200) {
+                  message.success(
+                    intl.formatMessage({
+                      id: 'pages.data.option.success',
+                      defaultMessage: '操作成功!',
+                    }),
+                  );
+                  actionRef.current?.reload();
+                }
               } else {
-                await service.disable(record.id);
+                const res = await service.disable(record.id);
+                if (res.status === 200) {
+                  message.success(
+                    intl.formatMessage({
+                      id: 'pages.data.option.success',
+                      defaultMessage: '操作成功!',
+                    }),
+                  );
+                  actionRef.current?.reload();
+                }
               }
-              message.success(
-                intl.formatMessage({
-                  id: 'pages.data.option.success',
-                  defaultMessage: '操作成功!',
-                }),
-              );
-              actionRef.current?.reload();
             },
           }}
           isPermission={permission.action}