|
|
@@ -41,7 +41,6 @@ const Access = () => {
|
|
|
const { permission } = usePermissions('device/Product');
|
|
|
const [dataSource, setDataSource] = useState<any[]>([]);
|
|
|
|
|
|
-
|
|
|
const MetworkTypeMapping = new Map();
|
|
|
MetworkTypeMapping.set('websocket-server', 'WEB_SOCKET_SERVER');
|
|
|
MetworkTypeMapping.set('http-server-gateway', 'HTTP_SERVER');
|
|
|
@@ -65,8 +64,7 @@ const Access = () => {
|
|
|
title: `<div id='title'>配置物模型</div><div id='guide'>1/3</div>`,
|
|
|
description: `配置产品物模型,实现设备在云端的功能描述。`,
|
|
|
position: 'bottom',
|
|
|
-
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
element: '.ant-switch',
|
|
|
@@ -74,8 +72,8 @@ const Access = () => {
|
|
|
className: 'driver',
|
|
|
title: `<div id='title'>启用产品</div><div id='guide'>2/3</div>`,
|
|
|
description: '启用产品后,可在产品下新增设备。',
|
|
|
- position: 'bottom'
|
|
|
- }
|
|
|
+ position: 'bottom',
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
element: '.ant-descriptions-item-label',
|
|
|
@@ -83,10 +81,10 @@ const Access = () => {
|
|
|
className: 'driver',
|
|
|
title: `<div id='title'>添加设备</div><div id='guide'>3/3</div>`,
|
|
|
description: '添加设备,并连接到平台。',
|
|
|
- position: 'bottom'
|
|
|
- }
|
|
|
- }
|
|
|
- ]
|
|
|
+ position: 'bottom',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
const steps1 = [
|
|
|
{
|
|
|
element: '#driver-config',
|
|
|
@@ -95,8 +93,7 @@ const Access = () => {
|
|
|
title: `<div id='title'>填写配置</div><div id='guide'>1/4</div>`,
|
|
|
description: `填写设备接入所需的配置参数。`,
|
|
|
position: 'right',
|
|
|
-
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
element: '#metadata-driver',
|
|
|
@@ -105,8 +102,7 @@ const Access = () => {
|
|
|
title: `<div id='title'>配置物模型</div><div id='guide'>2/4</div>`,
|
|
|
description: `配置产品物模型,实现设备在云端的功能描述。`,
|
|
|
position: 'bottom',
|
|
|
-
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
element: '.ant-switch',
|
|
|
@@ -114,8 +110,8 @@ const Access = () => {
|
|
|
className: 'driver',
|
|
|
title: `<div id='title'>启用产品</div><div id='guide'>3/4</div>`,
|
|
|
description: '启用产品后,可在产品下新增设备。',
|
|
|
- position: 'bottom'
|
|
|
- }
|
|
|
+ position: 'bottom',
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
element: '.ant-descriptions-item-label',
|
|
|
@@ -123,10 +119,10 @@ const Access = () => {
|
|
|
className: 'driver',
|
|
|
title: `<div id='title'>添加设备</div><div id='guide'>4/4</div>`,
|
|
|
description: '添加设备,并连接到平台。',
|
|
|
- position: 'bottom'
|
|
|
- }
|
|
|
- }
|
|
|
- ]
|
|
|
+ position: 'bottom',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
|
|
|
const queryAccessDetail = (id: string) => {
|
|
|
service
|
|
|
@@ -286,19 +282,18 @@ const Access = () => {
|
|
|
// onDeselected:(e)=>{
|
|
|
// console.log(e)
|
|
|
// },
|
|
|
- onNext:()=>{
|
|
|
- console.log('下一步')
|
|
|
+ onNext: () => {
|
|
|
+ console.log('下一步');
|
|
|
},
|
|
|
- onPrevious:()=>{
|
|
|
- console.log('上一步')
|
|
|
+ onPrevious: () => {
|
|
|
+ console.log('上一步');
|
|
|
},
|
|
|
- onReset:()=>{
|
|
|
- console.log('关闭')
|
|
|
+ onReset: () => {
|
|
|
+ console.log('关闭');
|
|
|
},
|
|
|
// onDeselected:()=>{
|
|
|
// console.log('oncolse')
|
|
|
// }
|
|
|
-
|
|
|
});
|
|
|
setVisible(!!productModel.current?.accessId);
|
|
|
if (productModel.current?.accessId) {
|
|
|
@@ -308,10 +303,10 @@ const Access = () => {
|
|
|
.then((resp: { result: SetStateAction<ConfigMetadata[]> }) => {
|
|
|
setMetadata(resp.result);
|
|
|
if (resp.result && resp.result.length > 0) {
|
|
|
- driver.defineSteps(steps1)
|
|
|
+ driver.defineSteps(steps1);
|
|
|
driver.start();
|
|
|
} else {
|
|
|
- driver.defineSteps(steps)
|
|
|
+ driver.defineSteps(steps);
|
|
|
driver.start();
|
|
|
}
|
|
|
});
|
|
|
@@ -388,11 +383,11 @@ const Access = () => {
|
|
|
enum:
|
|
|
item?.type?.type === 'enum' && item?.type?.elements
|
|
|
? (item?.type?.elements || []).map((t: { value: string; text: string }) => {
|
|
|
- return {
|
|
|
- label: t.text,
|
|
|
- value: t.value,
|
|
|
- };
|
|
|
- })
|
|
|
+ return {
|
|
|
+ label: t.text,
|
|
|
+ value: t.value,
|
|
|
+ };
|
|
|
+ })
|
|
|
: [],
|
|
|
};
|
|
|
});
|
|
|
@@ -429,7 +424,7 @@ const Access = () => {
|
|
|
title: (
|
|
|
<TitleComponent
|
|
|
data={
|
|
|
- <div className='config'>
|
|
|
+ <div className="config">
|
|
|
{item.name}
|
|
|
<Tooltip title="此配置来自于该产品接入方式所选择的协议">
|
|
|
<QuestionCircleOutlined />
|
|
|
@@ -582,14 +577,16 @@ const Access = () => {
|
|
|
<TitleComponent data={'连接信息'} />
|
|
|
{(access?.channelInfo?.addresses || []).length > 0
|
|
|
? (access?.channelInfo?.addresses || []).map((item: any) => (
|
|
|
- <div key={item.address}>
|
|
|
- <Badge color={item.health === -1 ? 'red' : 'green'} text={item.address} />
|
|
|
- </div>
|
|
|
- ))
|
|
|
+ <div key={item.address}>
|
|
|
+ <Badge color={item.health === -1 ? 'red' : 'green'} text={item.address} />
|
|
|
+ </div>
|
|
|
+ ))
|
|
|
: '暂无连接信息'}
|
|
|
</div>
|
|
|
|
|
|
- <div className={styles.item} id='driver-config'>{renderConfigCard()}</div>
|
|
|
+ <div className={styles.item} id="driver-config">
|
|
|
+ {renderConfigCard()}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</Col>
|
|
|
{config?.routes && config?.routes?.length > 0 && (
|
|
|
@@ -598,7 +595,7 @@ const Access = () => {
|
|
|
<div>
|
|
|
<div style={{ fontWeight: '600', marginBottom: 10 }}>
|
|
|
{access?.provider === 'mqtt-server-gateway' ||
|
|
|
- access?.provider === 'mqtt-client-gateway'
|
|
|
+ access?.provider === 'mqtt-client-gateway'
|
|
|
? 'topic'
|
|
|
: 'URL信息'}
|
|
|
</div>
|