Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Lind-pro committed Jul 13, 2020
2 parents b84e115 + 7ebb313 commit 690c47a
Show file tree
Hide file tree
Showing 10 changed files with 194 additions and 94 deletions.
12 changes: 10 additions & 2 deletions src/pages/device/alarm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ const Alarm: React.FC<Props> = props => {
const initState: State = {
data: [],
saveAlarmData: {},
searchParam: {pageSize: 10},
searchParam: {
pageSize: 10, sorts: {
order: "descend",
field: "alarmTime"
}
},
alarmLogData: {},
alarmDataList: [],
};
Expand Down Expand Up @@ -279,7 +284,10 @@ const Alarm: React.FC<Props> = props => {
pageIndex: searchParam.pageIndex,
pageSize: searchParam.pageSize,
terms,
sorts: searchParam.sorter,
sorts: searchParam.sorter || {
order: "descend",
field: "alarmTime"
},
});
};

Expand Down
2 changes: 1 addition & 1 deletion src/pages/device/instance/editor/detail/configuration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Configuration: React.FC<Props> = props => {
};

if (componentType !== 'enum') {
component = <Input type={componentType === 'password' ? 'password' : 'text'}/>;
component = componentType === 'password' ? <Input.Password/> : <Input type={'text'}/>;
} else {
const o = item.type.elements;
component = (
Expand Down
4 changes: 2 additions & 2 deletions src/pages/device/instance/editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@ const Editor: React.FC<Props> = props => {
tabList={tableList}
tabActiveKey={activeKey}
onTabChange={(key: string) => {
if (!data.metadata){
message.error('产品物模型数据错误');
if (!data.metadata) {
message.error('请检查设备产品物模型');
return;
}
setActiveKey(key);
Expand Down
2 changes: 2 additions & 0 deletions src/pages/device/product/data.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export class DeviceProduct {

protocolName: string;

protocolId: string;

configuration: any;

metadata: string;
Expand Down
13 changes: 10 additions & 3 deletions src/pages/device/product/save/Detail.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useEffect, useState} from 'react';
import {Badge, Button, Card, Descriptions, message, Popconfirm, Row, Spin, Tabs, Tooltip} from 'antd';
import {Badge, Button, Card, Descriptions, Input, message, Popconfirm, Row, Spin, Tabs, Tooltip} from 'antd';
import {PageHeaderWrapper} from '@ant-design/pro-layout';
import {connect} from 'dva';
import {router} from 'umi';
Expand Down Expand Up @@ -301,7 +301,7 @@ const Detail: React.FC<Props> = props => {
{basicInfo.orgName}
</Descriptions.Item>
<Descriptions.Item label="消息协议" span={1}>
{basicInfo.protocolName}
{basicInfo.protocolName || basicInfo.protocolId}
</Descriptions.Item>
<Descriptions.Item label="链接协议" span={1}>
{basicInfo.transportProtocol}
Expand Down Expand Up @@ -335,7 +335,14 @@ const Detail: React.FC<Props> = props => {
{config.properties &&
config.properties.map((item: any) => (
<Descriptions.Item label={item.property} span={1} key={item.property}>
{basicInfo.configuration ? basicInfo.configuration[item.property] : null}
{basicInfo.configuration ? (
item.type.type === 'password' ?
/*(<Input.Password style={{width: '25%'}} readOnly={true}
value={basicInfo.configuration[item.property]}/>)*/
'••••••'
:
basicInfo.configuration[item.property]
) : null}
</Descriptions.Item>
))}
</Descriptions>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/device/product/save/configuration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Configuration: React.FC<Props> = props => {
};

if (componentType !== 'enum') {
component = <Input type={componentType === 'password' ? 'password' : 'text'}/>;
component = componentType === 'password' ? <Input.Password/> : <Input type={'text'}/>;
} else {
const o = item.type.elements;
component = (
Expand Down
1 change: 1 addition & 0 deletions src/pages/device/protocol/save/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ const Save: React.FC<Props> = props => {
entity.configuration.script = script;
entity.configuration.transport = entity.configuration.transport.join(',');
}
debuggerData.payload = debuggerData.payload ? debuggerData.payload : payload;
const data = {
request: debuggerData,
entity,
Expand Down
Loading

0 comments on commit 690c47a

Please sign in to comment.